Skip to content

Commit d0f0e18

Browse files
committed
MAGETWO-99592: Discounts of products disappear on storefront after drag & drop via Visual Merchandiser in category
1 parent 995f4cb commit d0f0e18

File tree

2 files changed

+64
-30
lines changed

2 files changed

+64
-30
lines changed

app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use Magento\CatalogRule\Model\Indexer\IndexerTableSwapperInterface as TableSwapper;
1717

1818
/**
19+
* Catalog rule index builder
20+
*
1921
* @api
2022
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2123
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
@@ -538,7 +540,7 @@ protected function deleteOldData()
538540
* Calculate rule product price
539541
*
540542
* @param array $ruleData
541-
* @param null $productData
543+
* @param array $productData
542544
* @return float
543545
* @deprecated 100.2.0
544546
* @see ProductPriceCalculator::calculate

app/code/Magento/CatalogRule/Model/Rule.php

Lines changed: 61 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ protected function _getWebsitesMap()
432432
}
433433

434434
/**
435-
* {@inheritdoc}
435+
* @inheritdoc
436+
* @param \Magento\Framework\DataObject $dataObject
437+
* @return bool|string[]
436438
*/
437439
public function validateData(DataObject $dataObject)
438440
{
@@ -453,7 +455,6 @@ public function validateData(DataObject $dataObject)
453455
*
454456
* @param string $action
455457
* @param string|int|float $discount
456-
*
457458
* @return array Validation errors
458459
*/
459460
protected function validateDiscount($action, $discount)
@@ -581,8 +582,7 @@ protected function _invalidateCache()
581582
}
582583

583584
/**
584-
* {@inheritdoc}
585-
*
585+
* @inheritdoc
586586
* @return $this
587587
*/
588588
public function afterSave()
@@ -612,8 +612,7 @@ public function reindex()
612612
}
613613

614614
/**
615-
* {@inheritdoc}
616-
*
615+
* @inheritdoc
617616
* @return $this
618617
*/
619618
public function afterDelete()
@@ -642,9 +641,9 @@ public function isRuleBehaviorChanged()
642641

643642
/**
644643
* Get array with data differences
644+
*
645645
* @param array $array1
646646
* @param array $array2
647-
*
648647
* @return array
649648
*/
650649
protected function dataDiff($array1, $array2)
@@ -663,6 +662,8 @@ protected function dataDiff($array1, $array2)
663662
}
664663

665664
/**
665+
* Get conditions field set id
666+
*
666667
* @param string $formName
667668
* @return string
668669
*/
@@ -674,79 +675,94 @@ public function getConditionsFieldSetId($formName = '')
674675
//@codeCoverageIgnoreStart
675676

676677
/**
677-
* {@inheritdoc}
678+
* @inheritdoc
679+
* @return int|null
678680
*/
679681
public function getRuleId()
680682
{
681683
return $this->getData(self::RULE_ID);
682684
}
683685

684686
/**
685-
* {@inheritdoc}
687+
* @inheritdoc
688+
* @param int $ruleId
689+
* @return $this
686690
*/
687691
public function setRuleId($ruleId)
688692
{
689693
return $this->setData(self::RULE_ID, $ruleId);
690694
}
691695

692696
/**
693-
* {@inheritdoc}
697+
* @inheritdoc
698+
* @return string
694699
*/
695700
public function getName()
696701
{
697702
return $this->getData(self::NAME);
698703
}
699704

700705
/**
701-
* {@inheritdoc}
706+
* @inheritdoc
707+
* @param string $name
708+
* @return $this
702709
*/
703710
public function setName($name)
704711
{
705712
return $this->setData(self::NAME, $name);
706713
}
707714

708715
/**
709-
* {@inheritdoc}
716+
* @inheritdoc
717+
* @return string|null
710718
*/
711719
public function getDescription()
712720
{
713721
return $this->getData(self::DESCRIPTION);
714722
}
715723

716724
/**
717-
* {@inheritdoc}
725+
* @inheritdoc
726+
* @param string $description
727+
* @return $this
718728
*/
719729
public function setDescription($description)
720730
{
721731
return $this->setData(self::DESCRIPTION, $description);
722732
}
723733

724734
/**
725-
* {@inheritdoc}
735+
* @inheritdoc
736+
* @return int
726737
*/
727738
public function getIsActive()
728739
{
729740
return $this->getData(self::IS_ACTIVE);
730741
}
731742

732743
/**
733-
* {@inheritdoc}
744+
* @inheritdoc
745+
* @param int $isActive
746+
* @return $this
734747
*/
735748
public function setIsActive($isActive)
736749
{
737750
return $this->setData(self::IS_ACTIVE, $isActive);
738751
}
739752

740753
/**
741-
* {@inheritdoc}
754+
* @inheritdoc
755+
* @return \Magento\CatalogRule\Api\Data\ConditionInterface|null
742756
*/
743757
public function getRuleCondition()
744758
{
745759
return $this->getRuleConditionConverter()->arrayToDataModel($this->getConditions()->asArray());
746760
}
747761

748762
/**
749-
* {@inheritdoc}
763+
* @inheritdoc
764+
* @param \Magento\CatalogRule\Api\Data\ConditionInterface $condition
765+
* @return $this
750766
*/
751767
public function setRuleCondition($condition)
752768
{
@@ -757,70 +773,84 @@ public function setRuleCondition($condition)
757773
}
758774

759775
/**
760-
* {@inheritdoc}
776+
* @inheritdoc
777+
* @return int|null
761778
*/
762779
public function getStopRulesProcessing()
763780
{
764781
return $this->getData(self::STOP_RULES_PROCESSING);
765782
}
766783

767784
/**
768-
* {@inheritdoc}
785+
* @inheritdoc
786+
* @param int $isStopProcessing
787+
* @return $this
769788
*/
770789
public function setStopRulesProcessing($isStopProcessing)
771790
{
772791
return $this->setData(self::STOP_RULES_PROCESSING, $isStopProcessing);
773792
}
774793

775794
/**
776-
* {@inheritdoc}
795+
* @inheritdoc
796+
* @return int|null
777797
*/
778798
public function getSortOrder()
779799
{
780800
return $this->getData(self::SORT_ORDER);
781801
}
782802

783803
/**
784-
* {@inheritdoc}
804+
* @inheritdoc
805+
* @param int $sortOrder
806+
* @return $this
785807
*/
786808
public function setSortOrder($sortOrder)
787809
{
788810
return $this->setData(self::SORT_ORDER, $sortOrder);
789811
}
790812

791813
/**
792-
* {@inheritdoc}
814+
* @inheritdoc
815+
* @return string
793816
*/
794817
public function getSimpleAction()
795818
{
796819
return $this->getData(self::SIMPLE_ACTION);
797820
}
798821

799822
/**
800-
* {@inheritdoc}
823+
* @inheritdoc
824+
* @param string $action
825+
* @return $this
801826
*/
802827
public function setSimpleAction($action)
803828
{
804829
return $this->setData(self::SIMPLE_ACTION, $action);
805830
}
806831

807832
/**
808-
* {@inheritdoc}
833+
* @inheritdoc
834+
* @return float
809835
*/
810836
public function getDiscountAmount()
811837
{
812838
return $this->getData(self::DISCOUNT_AMOUNT);
813839
}
814840

815841
/**
816-
* {@inheritdoc}
842+
* @inheritdoc
843+
* @param float $amount
844+
* @return $this
817845
*/
818846
public function setDiscountAmount($amount)
819847
{
820848
return $this->setData(self::DISCOUNT_AMOUNT, $amount);
821849
}
822850

823851
/**
852+
* Get from date
853+
*
824854
* @return string
825855
*/
826856
public function getFromDate()
@@ -829,6 +859,8 @@ public function getFromDate()
829859
}
830860

831861
/**
862+
* Get to date
863+
*
832864
* @return string
833865
*/
834866
public function getToDate()
@@ -837,8 +869,7 @@ public function getToDate()
837869
}
838870

839871
/**
840-
* {@inheritdoc}
841-
*
872+
* @inheritdoc
842873
* @return \Magento\CatalogRule\Api\Data\RuleExtensionInterface|null
843874
*/
844875
public function getExtensionAttributes()
@@ -847,8 +878,7 @@ public function getExtensionAttributes()
847878
}
848879

849880
/**
850-
* {@inheritdoc}
851-
*
881+
* @inheritdoc
852882
* @param \Magento\CatalogRule\Api\Data\RuleExtensionInterface $extensionAttributes
853883
* @return $this
854884
*/
@@ -858,6 +888,8 @@ public function setExtensionAttributes(RuleExtensionInterface $extensionAttribut
858888
}
859889

860890
/**
891+
* Get rule condition converter
892+
*
861893
* @return Data\Condition\Converter
862894
* @deprecated 100.1.0
863895
*/

0 commit comments

Comments
 (0)