-
valic β
committed 86f9393f on 8.x-1.x authored by
dd_leo β
Issue #3255927 by dd_leo, valic: Add restriction a coupon usage for...
-
valic β
committed 86f9393f on 8.x-1.x authored by
dd_leo β
- Issue was unassigned.
- Status changed to Active
almost 2 years ago 12:30am 16 February 2023 - ππ·Croatia valic Osijek
Think we can almost completely remove duplicate code, and rely on parent method check, if it returns true we do check for conditions than
- πͺπΈSpain interdruper
Besides (correctly) handle the coupon usage per-customer limit functionality, the latest commit also relies in the parent coupon entity date fields:
$fields['start_date'] = BaseFieldDefinition::create('datetime') ->setLabel(t('Start date')) ->setDescription(t('The date the coupon becomes valid.')) ->setRequired(FALSE) ->setSetting('datetime_type', 'datetime') ->setSetting('datetime_optional_label', t('Provide a start date')) ->setDefaultValueCallback('Drupal\commerce_promotion\Entity\Promotion::getDefaultStartDate') ->setDisplayOptions('form', [ 'type' => 'commerce_store_datetime', 'weight' => 5, ]); $fields['end_date'] = BaseFieldDefinition::create('datetime') ->setLabel(t('End date')) ->setDescription(t('The date after which the coupon is invalid.')) ->setRequired(FALSE) ->setSetting('datetime_type', 'datetime') ->setSetting('datetime_optional_label', t('Provide an end date')) ->setDisplayOptions('form', [ 'type' => 'commerce_store_datetime', 'weight' => 6, ]);
... but the parent definitions are not backward-compatible with the previous definitions used by this module:
$fields['start_date'] = BaseFieldDefinition::create('datetime') ->setLabel(t('Start date')) ->setDescription(t('The date the promotion becomes valid.')) ->setRequired(FALSE) ->setSetting('datetime_type', 'date') ->setDisplayOptions('form', [ 'type' => 'datetime_default', 'weight' => 8, ]); $fields['end_date'] = BaseFieldDefinition::create('datetime') ->setLabel(t('End date')) ->setDescription(t('The date after which the promotion is invalid.')) ->setRequired(FALSE) ->setSetting('datetime_type', 'date') ->setDisplayOptions('form', [ 'type' => 'commerce_end_date', 'weight' => 9, ]);
So any dates defined on coupons created previously using this module are not available after applying the last commit...
- Status changed to RTBC
over 1 year ago 5:39am 15 August 2023 - π¦πΊAustralia elc
In combination with π Remove local start_date and end_date base fields and fix existing dates Fixed , this fixes the introduced incompatibilities of the now parent entity handled coupon properties of "per user", and "start_date/end_date".
- Status changed to Fixed
about 1 year ago 2:07pm 10 November 2023 Automatically closed - issue fixed for 2 weeks with no activity.