diff --git a/features/product_quantity_price_rules/simple_quantity_price_rule.feature b/features/product_quantity_price_rules/simple_quantity_price_rule.feature index c4d332ed18..47a542bfdd 100644 --- a/features/product_quantity_price_rules/simple_quantity_price_rule.feature +++ b/features/product_quantity_price_rules/simple_quantity_price_rule.feature @@ -11,7 +11,7 @@ Feature: Adding a new product with a simple quantity price rule Scenario: Add a quantity price rule with no conditions Given adding a quantity price rule to product "Shoe" named "default-product-quantity-price-rule" and with calculation-behaviour "volume" And the quantity price rule is active - And the quantity price rule has a range from 0 to 10 with behaviour percentage-decrease of 10% + And the quantity price rule has a range starting from 0 with behaviour percentage-decrease of 10% Then the quantity price rule should be valid for product "Shoe" And the product "Shoe" should be priced at "10000" Given I add the product "Shoe" to my cart diff --git a/src/CoreShop/Behat/Context/Setup/ProductQuantityPriceRuleContext.php b/src/CoreShop/Behat/Context/Setup/ProductQuantityPriceRuleContext.php index 3e87503349..01d686311d 100644 --- a/src/CoreShop/Behat/Context/Setup/ProductQuantityPriceRuleContext.php +++ b/src/CoreShop/Behat/Context/Setup/ProductQuantityPriceRuleContext.php @@ -140,10 +140,10 @@ public function theProductQuantityPriceRuleIsInActive(ProductQuantityPriceRuleIn } /** - * @Given /^the (quantity price rule "[^"]+") has a range from ([^"]+) to ([^"]+) with behaviour percentage-decrease of ([^"]+)%$/ - * @Given /^the (quantity price rule) has a range from ([^"]+) to ([^"]+) with behaviour percentage-decrease of ([^"]+)%$/ + * @Given /^the (quantity price rule "[^"]+") has a range starting from ([^"]+) with behaviour percentage-decrease of ([^"]+)%$/ + * @Given /^the (quantity price rule) has a range starting from ([^"]+) with behaviour percentage-decrease of ([^"]+)%$/ */ - public function theProductQuantityPriceRuleHasRangePercentageDecrease(ProductQuantityPriceRuleInterface $rule, int $from, int $to, $percentage) + public function theProductQuantityPriceRuleHasRangePercentageDecrease(ProductQuantityPriceRuleInterface $rule, int $from, $percentage) { /** * @var QuantityRangeInterface $range @@ -151,17 +151,16 @@ public function theProductQuantityPriceRuleHasRangePercentageDecrease(ProductQua $range = $this->rangeFactory->createNew(); $range->setPricingBehaviour('percentage_decrease'); $range->setPercentage($percentage); - $range->setRangeFrom($from); - $range->setRangeTo($to); + $range->setRangeStartingFrom($from); $this->addRange($rule, $range); } /** - * @Given /^the (quantity price rule "[^"]+") has a range from ([^"]+) to ([^"]+) with behaviour percentage-increase of ([^"]+)%$/ - * @Given /^the (quantity price rule) has a range from ([^"]+) to ([^"]+) with behaviour percentage-increase of ([^"]+)%$/ + * @Given /^the (quantity price rule "[^"]+") has a range starting from to ([^"]+) with behaviour percentage-increase of ([^"]+)%$/ + * @Given /^the (quantity price rule) has a range starting from ([^"]+) with behaviour percentage-increase of ([^"]+)%$/ */ - public function theProductQuantityPriceRuleHasRangePercentageIncrease(ProductQuantityPriceRuleInterface $rule, int $from, int $to, $percentage) + public function theProductQuantityPriceRuleHasRangePercentageIncrease(ProductQuantityPriceRuleInterface $rule, int $from, $percentage) { /** * @var QuantityRangeInterface $range @@ -169,20 +168,18 @@ public function theProductQuantityPriceRuleHasRangePercentageIncrease(ProductQua $range = $this->rangeFactory->createNew(); $range->setPricingBehaviour('percentage_increase'); $range->setPercentage($percentage); - $range->setRangeFrom($from); - $range->setRangeTo($to); + $range->setRangeStartingFrom($from); $this->addRange($rule, $range); } /** - * @Given /^the (quantity price rule "[^"]+") has a range from ([^"]+) to ([^"]+) with behaviour amount-decrease of ([^"]+) in (currency "[^"]+")$/ - * @Given /^the (quantity price rule) has a range from ([^"]+) to ([^"]+) with behaviour amount-decrease of ([^"]+) in (currency "[^"]+")$/ + * @Given /^the (quantity price rule "[^"]+") has a range starting from ([^"]+) with behaviour amount-decrease of ([^"]+) in (currency "[^"]+")$/ + * @Given /^the (quantity price rule) has a range starting from ([^"]+) with behaviour amount-decrease of ([^"]+) in (currency "[^"]+")$/ */ public function theProductQuantityPriceRuleHasRangeAmountDecrease( ProductQuantityPriceRuleInterface $rule, int $from, - int $to, $amount, CurrencyInterface $currency ) { @@ -192,21 +189,19 @@ public function theProductQuantityPriceRuleHasRangeAmountDecrease( $range = $this->rangeFactory->createNew(); $range->setPricingBehaviour('amount_decrease'); $range->setAmount($amount); - $range->setRangeFrom($from); - $range->setRangeTo($to); + $range->setRangeStartingFrom($from); $range->setCurrency($currency); $this->addRange($rule, $range); } /** - * @Given /^the (quantity price rule "[^"]+") has a range from ([^"]+) to ([^"]+) with behaviour amount-increase of ([^"]+) in (currency "[^"]+")$/ - * @Given /^the (quantity price rule) has a range from ([^"]+) to ([^"]+) with behaviour amount-increase of ([^"]+) in (currency "[^"]+")$/ + * @Given /^the (quantity price rule "[^"]+") has a range starting from ([^"]+) with behaviour amount-increase of ([^"]+) in (currency "[^"]+")$/ + * @Given /^the (quantity price rule) has a range starting from ([^"]+) with behaviour amount-increase of ([^"]+) in (currency "[^"]+")$/ */ public function theProductQuantityPriceRuleHasRangeAmountIncrease( ProductQuantityPriceRuleInterface $rule, int $from, - int $to, $amount, CurrencyInterface $currency ) { @@ -216,18 +211,17 @@ public function theProductQuantityPriceRuleHasRangeAmountIncrease( $range = $this->rangeFactory->createNew(); $range->setPricingBehaviour('amount_increase'); $range->setAmount($amount); - $range->setRangeFrom($from); - $range->setRangeTo($to); + $range->setRangeStartingFrom($from); $range->setCurrency($currency); $this->addRange($rule, $range); } /** - * @Given /^the (quantity price rule "[^"]+") has a range from ([^"]+) to ([^"]+) with behaviour fixed of ([^"]+) in (currency "[^"]+")$/ - * @Given /^the (quantity price rule) has a range from ([^"]+) to ([^"]+) with behaviour fixed of ([^"]+) in (currency "[^"]+")$/ + * @Given /^the (quantity price rule "[^"]+") has a range starting from ([^"]+) with behaviour fixed of ([^"]+) in (currency "[^"]+")$/ + * @Given /^the (quantity price rule) has a range starting from ([^"]+) with behaviour fixed of ([^"]+) in (currency "[^"]+")$/ */ - public function theProductQuantityPriceRuleHasRangeFixed(ProductQuantityPriceRuleInterface $rule, int $from, int $to, $amount, CurrencyInterface $currency) + public function theProductQuantityPriceRuleHasRangeFixed(ProductQuantityPriceRuleInterface $rule, int $from, $amount, CurrencyInterface $currency) { /** * @var QuantityRangeInterface $range @@ -235,8 +229,7 @@ public function theProductQuantityPriceRuleHasRangeFixed(ProductQuantityPriceRul $range = $this->rangeFactory->createNew(); $range->setPricingBehaviour('fixed'); $range->setAmount($amount); - $range->setRangeFrom($from); - $range->setRangeTo($to); + $range->setRangeStartingFrom($from); $range->setCurrency($currency); $this->addRange($rule, $range); diff --git a/src/CoreShop/Bundle/CoreBundle/Form/Extension/ProductQuantityRangeCollectionTypeExtension.php b/src/CoreShop/Bundle/CoreBundle/Form/Extension/ProductQuantityRangeCollectionTypeExtension.php index a422620ca0..ebba0edc39 100644 --- a/src/CoreShop/Bundle/CoreBundle/Form/Extension/ProductQuantityRangeCollectionTypeExtension.php +++ b/src/CoreShop/Bundle/CoreBundle/Form/Extension/ProductQuantityRangeCollectionTypeExtension.php @@ -51,9 +51,8 @@ public function buildForm(FormBuilderInterface $builder, array $options) } $dataCheck[$unit][] = [ - 'row' => $realRowIndex, - 'from' => $quantityRange->getRangeFrom(), - 'to' => $quantityRange->getRangeTo(), + 'row' => $realRowIndex, + 'startingFrom' => $quantityRange->getRangeStartingFrom() ]; } @@ -71,29 +70,20 @@ public function buildForm(FormBuilderInterface $builder, array $options) foreach ($quantityRangesToCheck as $quantityRange) { $realRowIndex = $quantityRange['row']; - $from = $quantityRange['from']; - $to = $quantityRange['to']; + $startingFrom = $quantityRange['startingFrom']; - if (!is_numeric($from)) { - $form->addError(new FormError('Field "from" in row ' . $realRowIndex . ' needs to be numeric')); + if (!is_numeric($startingFrom)) { + $form->addError(new FormError('Field "starting from" in row ' . $realRowIndex . ' needs to be numeric')); break; - } elseif ((int) $from < 0) { - $form->addError(new FormError('Field "from" in row ' . $realRowIndex . ' needs to be greater or equal than 0')); + } elseif ((int) $startingFrom < 0) { + $form->addError(new FormError('Field "starting from" in row ' . $realRowIndex . ' needs to be greater or equal than 0')); break; - } elseif ((int) $from < $lastEnd) { - $form->addError(new FormError('Field "from" in row ' . $realRowIndex . ' needs to be greater than ' . $lastEnd)); + } elseif ((int) $startingFrom <= $lastEnd) { + $form->addError(new FormError('Field "starting from" in row ' . $realRowIndex . ' needs to be greater than ' . $lastEnd)); break; } - if (!is_numeric($to)) { - $form->addError(new FormError('Field "to" in row ' . $realRowIndex . ' needs to be numeric')); - break; - } elseif ((int) $to < $from) { - $form->addError(new FormError('Field "to" in row ' . $realRowIndex . ' needs to be greater than ' . $from)); - break; - } - - $lastEnd = (int) $to; + $lastEnd = (int) $startingFrom; } } }); diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/productquantitypricerules/ranges.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/productquantitypricerules/ranges.js index 9fc8f3fb05..025b6ccaf2 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/productquantitypricerules/ranges.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/productquantitypricerules/ranges.js @@ -80,8 +80,7 @@ coreshop.product_quantity_price_rules.ranges = Class.create(coreshop.product_qua grid.getStore().each(function (record) { ranges.push({ 'id': record.get('rangeId'), - 'rangeFrom': record.get('rangeFrom'), - 'rangeTo': record.get('rangeTo'), + 'rangeStartingFrom': record.get('rangeStartingFrom'), 'pricingBehaviour': record.get('pricingBehaviour'), 'unitDefinition': record.get('unitDefinition'), 'amount': record.get('amount'), diff --git a/src/CoreShop/Bundle/CoreBundle/Validator/Constraints/QuantityRangePriceCurrencyAware.php b/src/CoreShop/Bundle/CoreBundle/Validator/Constraints/QuantityRangePriceCurrencyAware.php index 17445e95b8..a48939059b 100644 --- a/src/CoreShop/Bundle/CoreBundle/Validator/Constraints/QuantityRangePriceCurrencyAware.php +++ b/src/CoreShop/Bundle/CoreBundle/Validator/Constraints/QuantityRangePriceCurrencyAware.php @@ -16,5 +16,5 @@ class QuantityRangePriceCurrencyAware extends Constraint { - public $message = '{{ range }} needs a valid currency to work.'; + public $message = '{{ rangeStartingFrom }} needs a valid currency to work.'; } diff --git a/src/CoreShop/Bundle/CoreBundle/Validator/Constraints/QuantityRangePriceCurrencyAwareValidator.php b/src/CoreShop/Bundle/CoreBundle/Validator/Constraints/QuantityRangePriceCurrencyAwareValidator.php index 0a1589398a..eef8c6fec0 100644 --- a/src/CoreShop/Bundle/CoreBundle/Validator/Constraints/QuantityRangePriceCurrencyAwareValidator.php +++ b/src/CoreShop/Bundle/CoreBundle/Validator/Constraints/QuantityRangePriceCurrencyAwareValidator.php @@ -35,7 +35,7 @@ public function validate($value, Constraint $constraint) if (!$value->getCurrency() instanceof CurrencyInterface) { $this->context->buildViolation($constraint->message) - ->setParameter('{{ range }}', sprintf('Range from %d to %d', $value->getRangeFrom(), $value->getRangeTo())) + ->setParameter('{{ rangeStartingFrom }}', sprintf('Range starting from %d', $value->getRangeStartingFrom())) ->addViolation(); } } diff --git a/src/CoreShop/Bundle/FrontendBundle/Resources/views/ProductQuantityPriceRanges/quantity_price_ranges_volume.html.twig b/src/CoreShop/Bundle/FrontendBundle/Resources/views/ProductQuantityPriceRanges/quantity_price_ranges_volume.html.twig index 9b6550de4a..d54e252a07 100644 --- a/src/CoreShop/Bundle/FrontendBundle/Resources/views/ProductQuantityPriceRanges/quantity_price_ranges_volume.html.twig +++ b/src/CoreShop/Bundle/FrontendBundle/Resources/views/ProductQuantityPriceRanges/quantity_price_ranges_volume.html.twig @@ -53,7 +53,7 @@ {% for range in sorted_unit_range.ranges %} - {{ 'coreshop.ui.product_quantity_price_rules.starting_from'|trans }} {{ range.getRangeFrom() }} + {{ 'coreshop.ui.product_quantity_price_rules.starting_from'|trans }} {{ range.getRangeStartingFrom() }} {% if range.isHighlighted() %} {{ 'coreshop.ui.product_quantity_price_rules.best_offer'|trans }} {% endif %} diff --git a/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Form/Type/ProductQuantityRangeType.php b/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Form/Type/ProductQuantityRangeType.php index 344b252a92..2a9e34ed52 100644 --- a/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Form/Type/ProductQuantityRangeType.php +++ b/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Form/Type/ProductQuantityRangeType.php @@ -55,8 +55,7 @@ public function buildForm(FormBuilderInterface $builder, array $options = []) parent::buildForm($builder, $options); $builder - ->add('rangeFrom', IntegerType::class, []) - ->add('rangeTo', IntegerType::class, []) + ->add('rangeStartingFrom', IntegerType::class, []) ->add('pricingBehaviour', ChoiceType::class, [ 'choices' => $this->actionTypes, ]) diff --git a/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/config/doctrine/model/QuantityRange.orm.yml b/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/config/doctrine/model/QuantityRange.orm.yml index 4fa0b469d7..cbe2513d2c 100644 --- a/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/config/doctrine/model/QuantityRange.orm.yml +++ b/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/config/doctrine/model/QuantityRange.orm.yml @@ -8,11 +8,8 @@ CoreShop\Component\ProductQuantityPriceRules\Model\QuantityRange: id: true generator: strategy: AUTO - rangeFrom: - column: range_from - type: integer - rangeTo: - column: range_to + rangeStartingFrom: + column: range_starting_from type: integer pricingBehaviour: column: pricing_behaviour diff --git a/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/public/pimcore/js/productQuantityPriceRules/ranges.js b/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/public/pimcore/js/productQuantityPriceRules/ranges.js index 7f12baf600..508f9ac641 100644 --- a/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/public/pimcore/js/productQuantityPriceRules/ranges.js +++ b/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/public/pimcore/js/productQuantityPriceRules/ranges.js @@ -108,8 +108,7 @@ coreshop.product_quantity_price_rules.ranges = Class.create({ grid.getStore().each(function (record) { ranges.push({ 'id': record.get('rangeId'), - 'rangeFrom': record.get('rangeFrom'), - 'rangeTo': record.get('rangeTo'), + 'rangeStartingFrom': record.get('rangeStartingFrom'), 'pricingBehaviour': record.get('pricingBehaviour'), 'highlighted': record.get('highlighted'), }); @@ -150,12 +149,12 @@ coreshop.product_quantity_price_rules.ranges = Class.create({ hidden: true }, { - text: t('coreshop_product_quantity_price_rules_range_from'), + text: t('coreshop_product_quantity_price_rules_range_starting_from'), flex: 1, sortable: false, readOnly: true, - dataIndex: 'rangeFrom', - name: 'quantity_range_from', + dataIndex: 'rangeStartingFrom', + name: 'quantity_range_starting_from', getEditor: function () { return new Ext.form.NumberField({ minValue: 0 @@ -168,25 +167,6 @@ coreshop.product_quantity_price_rules.ranges = Class.create({ return value + ' ' + t('coreshop_product_quantity_price_rules_quantity_amount'); } }, - { - text: t('coreshop_product_quantity_price_rules_range_to'), - flex: 1, - sortable: false, - dataIndex: 'rangeTo', - name: 'quantity_range_to', - getEditor: function () { - return new Ext.form.NumberField({ - minValue: 1 - }); - }, - renderer: function (value, cell, record, rowIndex) { - var lastElement = record.store.getRange().length === (rowIndex + 1); - if (value === undefined || value === null) { - return '0' + ' ' + t('coreshop_product_quantity_price_rules_quantity_amount'); - } - return value + ' ' + t('coreshop_product_quantity_price_rules_quantity_amount') + (lastElement === true ? '+' : ''); - } - }, { text: t('coreshop_product_quantity_price_rules_behaviour'), flex: 1, @@ -426,8 +406,7 @@ coreshop.product_quantity_price_rules.ranges = Class.create({ lastEntry = grid.getStore().last(); return new modelClass({ - rangeFrom: lastEntry !== null ? lastEntry.get('rangeTo') + 1 : 0, - rangeTo: lastEntry !== null ? lastEntry.get('rangeTo') + 10 : 10, + rangeStartingFrom: lastEntry !== null ? lastEntry.get('rangeStartingFrom') + 10 : 0, pricingBehaviour: 'fixed', highlight: false, rangeId: null diff --git a/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/translations/admin.de.yml b/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/translations/admin.de.yml index c171b2436f..548e715bec 100644 --- a/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/translations/admin.de.yml +++ b/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/translations/admin.de.yml @@ -2,8 +2,7 @@ coreshop_product_quantity_price_rules: 'Produkt Stückmengen-Preisregeln' coreshop_product_quantity_price_rules_calculation_behaviour: 'Berechnungsverhalten' coreshop_product_quantity_price_rules_ranges: 'Stückmengen-Preisregeln' -coreshop_product_quantity_price_rules_range_from: 'Von' -coreshop_product_quantity_price_rules_range_to: 'Bis' +coreshop_product_quantity_price_rules_range_starting_from: 'Ab' coreshop_product_quantity_price_rules_highlight: 'Hervorheben' coreshop_product_quantity_price_rules_quantity_amount: 'Einheiten' coreshop_product_quantity_price_rules_copy_ranges: 'Bereiche kopieren' diff --git a/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/translations/admin.en.yml b/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/translations/admin.en.yml index 029f549077..dbe23e1673 100644 --- a/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/translations/admin.en.yml +++ b/src/CoreShop/Bundle/ProductQuantityPriceRulesBundle/Resources/translations/admin.en.yml @@ -1,8 +1,7 @@ coreshop_product_quantity_price_rules: 'Product Quantity Price Rules' coreshop_product_quantity_price_rules_calculation_behaviour: 'Calculation Behaviour' coreshop_product_quantity_price_rules_ranges: 'Quantity Price Ranges' -coreshop_product_quantity_price_rules_range_from: 'From' -coreshop_product_quantity_price_rules_range_to: 'To' +coreshop_product_quantity_price_rules_range_starting_from: 'Starting from' coreshop_product_quantity_price_rules_highlight: 'Highlight' coreshop_product_quantity_price_rules_quantity_amount: 'Units' coreshop_product_quantity_price_rules_copy_ranges: 'Copy Ranges' diff --git a/src/CoreShop/Component/Core/ProductQuantityPriceRules/Calculator/UnitVolumeCalculator.php b/src/CoreShop/Component/Core/ProductQuantityPriceRules/Calculator/UnitVolumeCalculator.php index a5fb2b09a3..9d40b24ff9 100644 --- a/src/CoreShop/Component/Core/ProductQuantityPriceRules/Calculator/UnitVolumeCalculator.php +++ b/src/CoreShop/Component/Core/ProductQuantityPriceRules/Calculator/UnitVolumeCalculator.php @@ -122,16 +122,11 @@ protected function locate(Collection $ranges, int $quantity, ProductUnitDefiniti /** @var CoreQuantityRangeInterface $range */ foreach ($unitFilteredRanges as $index => $range) { - // if last range and quantity is greater: count! - if ($index+1 === count($unitFilteredRanges) && $quantity > $range->getRangeTo()) { - $cheapestRangePrice = $range; + if ($range->getRangeStartingFrom() > $quantity) { break; } - if ($range->getRangeFrom() <= $quantity && $quantity <= $range->getRangeTo()) { - $cheapestRangePrice = $range; - break; - } + $cheapestRangePrice = $range; } return $cheapestRangePrice; diff --git a/src/CoreShop/Component/ProductQuantityPriceRules/Calculator/VolumeCalculator.php b/src/CoreShop/Component/ProductQuantityPriceRules/Calculator/VolumeCalculator.php index be4cadd54f..4990d3b38b 100644 --- a/src/CoreShop/Component/ProductQuantityPriceRules/Calculator/VolumeCalculator.php +++ b/src/CoreShop/Component/ProductQuantityPriceRules/Calculator/VolumeCalculator.php @@ -113,16 +113,12 @@ protected function locate(Collection $ranges, int $quantity) $cheapestRangePrice = null; /** @var QuantityRangeInterface $range */ foreach ($ranges as $index => $range) { - // if last range and quantity is greater: count! - if ($index + 1 === count($ranges) && $quantity > $range->getRangeTo()) { - $cheapestRangePrice = $range; - break; - } - if ($range->getRangeFrom() <= $quantity && $quantity <= $range->getRangeTo()) { - $cheapestRangePrice = $range; + if ($range->getRangeStartingFrom() > $quantity) { break; } + + $cheapestRangePrice = $range; } return $cheapestRangePrice; diff --git a/src/CoreShop/Component/ProductQuantityPriceRules/Model/QuantityRange.php b/src/CoreShop/Component/ProductQuantityPriceRules/Model/QuantityRange.php index ad6726cbe8..a99528c25e 100644 --- a/src/CoreShop/Component/ProductQuantityPriceRules/Model/QuantityRange.php +++ b/src/CoreShop/Component/ProductQuantityPriceRules/Model/QuantityRange.php @@ -24,12 +24,7 @@ class QuantityRange extends AbstractResource implements QuantityRangeInterface /** * @var int */ - protected $rangeFrom; - - /** - * @var int - */ - protected $rangeTo; + protected $rangeStartingFrom; /** * @var string @@ -70,33 +65,17 @@ public function setId($id) /** * {@inheritdoc} */ - public function getRangeFrom() - { - return $this->rangeFrom; - } - - /** - * {@inheritdoc} - */ - public function setRangeFrom(int $rangeFrom) - { - $this->rangeFrom = $rangeFrom; - } - - /** - * {@inheritdoc} - */ - public function getRangeTo() + public function getRangeStartingFrom() { - return $this->rangeTo; + return $this->rangeStartingFrom; } /** * {@inheritdoc} */ - public function setRangeTo(int $rangeTo) + public function setRangeStartingFrom(int $rangeStartingFrom) { - $this->rangeTo = $rangeTo; + $this->rangeStartingFrom = $rangeStartingFrom; } /** diff --git a/src/CoreShop/Component/ProductQuantityPriceRules/Model/QuantityRangeInterface.php b/src/CoreShop/Component/ProductQuantityPriceRules/Model/QuantityRangeInterface.php index e892b4907a..7fd2423831 100644 --- a/src/CoreShop/Component/ProductQuantityPriceRules/Model/QuantityRangeInterface.php +++ b/src/CoreShop/Component/ProductQuantityPriceRules/Model/QuantityRangeInterface.php @@ -19,22 +19,12 @@ interface QuantityRangeInterface extends ResourceInterface /** * @return int */ - public function getRangeFrom(); + public function getRangeStartingFrom(); /** - * @param int $rangeFrom + * @param int $rangeStartingFrom */ - public function setRangeFrom(int $rangeFrom); - - /** - * @return int - */ - public function getRangeTo(); - - /** - * @param int $rangeTo - */ - public function setRangeTo(int $rangeTo); + public function setRangeStartingFrom(int $rangeStartingFrom); /** * @return string