Skip to content

Commit e912e6b

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

File tree

1 file changed

+30
-61
lines changed
  • app/code/Magento/CatalogRule/Model

1 file changed

+30
-61
lines changed

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

Lines changed: 30 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
* @method \Magento\CatalogRule\Model\Rule setFromDate(string $value)
4242
* @method \Magento\CatalogRule\Model\Rule setToDate(string $value)
4343
* @method \Magento\CatalogRule\Model\Rule setCustomerGroupIds(string $value)
44+
* @method string getWebsiteIds()
4445
* @method \Magento\CatalogRule\Model\Rule setWebsiteIds(string $value)
4546
* @SuppressWarnings(PHPMD.TooManyFields)
4647
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -432,9 +433,7 @@ protected function _getWebsitesMap()
432433
}
433434

434435
/**
435-
* @inheritdoc
436-
* @param \Magento\Framework\DataObject $dataObject
437-
* @return bool|string[]
436+
* {@inheritdoc}
438437
*/
439438
public function validateData(DataObject $dataObject)
440439
{
@@ -455,6 +454,7 @@ public function validateData(DataObject $dataObject)
455454
*
456455
* @param string $action
457456
* @param string|int|float $discount
457+
*
458458
* @return array Validation errors
459459
*/
460460
protected function validateDiscount($action, $discount)
@@ -582,7 +582,8 @@ protected function _invalidateCache()
582582
}
583583

584584
/**
585-
* @inheritdoc
585+
* {@inheritdoc}
586+
*
586587
* @return $this
587588
*/
588589
public function afterSave()
@@ -612,7 +613,8 @@ public function reindex()
612613
}
613614

614615
/**
615-
* @inheritdoc
616+
* {@inheritdoc}
617+
*
616618
* @return $this
617619
*/
618620
public function afterDelete()
@@ -641,9 +643,9 @@ public function isRuleBehaviorChanged()
641643

642644
/**
643645
* Get array with data differences
644-
*
645646
* @param array $array1
646647
* @param array $array2
648+
*
647649
* @return array
648650
*/
649651
protected function dataDiff($array1, $array2)
@@ -662,8 +664,6 @@ protected function dataDiff($array1, $array2)
662664
}
663665

664666
/**
665-
* Get conditions field set id
666-
*
667667
* @param string $formName
668668
* @return string
669669
*/
@@ -675,94 +675,79 @@ public function getConditionsFieldSetId($formName = '')
675675
//@codeCoverageIgnoreStart
676676

677677
/**
678-
* @inheritdoc
679-
* @return int|null
678+
* {@inheritdoc}
680679
*/
681680
public function getRuleId()
682681
{
683682
return $this->getData(self::RULE_ID);
684683
}
685684

686685
/**
687-
* @inheritdoc
688-
* @param int $ruleId
689-
* @return $this
686+
* {@inheritdoc}
690687
*/
691688
public function setRuleId($ruleId)
692689
{
693690
return $this->setData(self::RULE_ID, $ruleId);
694691
}
695692

696693
/**
697-
* @inheritdoc
698-
* @return string
694+
* {@inheritdoc}
699695
*/
700696
public function getName()
701697
{
702698
return $this->getData(self::NAME);
703699
}
704700

705701
/**
706-
* @inheritdoc
707-
* @param string $name
708-
* @return $this
702+
* {@inheritdoc}
709703
*/
710704
public function setName($name)
711705
{
712706
return $this->setData(self::NAME, $name);
713707
}
714708

715709
/**
716-
* @inheritdoc
717-
* @return string|null
710+
* {@inheritdoc}
718711
*/
719712
public function getDescription()
720713
{
721714
return $this->getData(self::DESCRIPTION);
722715
}
723716

724717
/**
725-
* @inheritdoc
726-
* @param string $description
727-
* @return $this
718+
* {@inheritdoc}
728719
*/
729720
public function setDescription($description)
730721
{
731722
return $this->setData(self::DESCRIPTION, $description);
732723
}
733724

734725
/**
735-
* @inheritdoc
736-
* @return int
726+
* {@inheritdoc}
737727
*/
738728
public function getIsActive()
739729
{
740730
return $this->getData(self::IS_ACTIVE);
741731
}
742732

743733
/**
744-
* @inheritdoc
745-
* @param int $isActive
746-
* @return $this
734+
* {@inheritdoc}
747735
*/
748736
public function setIsActive($isActive)
749737
{
750738
return $this->setData(self::IS_ACTIVE, $isActive);
751739
}
752740

753741
/**
754-
* @inheritdoc
755-
* @return \Magento\CatalogRule\Api\Data\ConditionInterface|null
742+
* {@inheritdoc}
756743
*/
757744
public function getRuleCondition()
758745
{
759746
return $this->getRuleConditionConverter()->arrayToDataModel($this->getConditions()->asArray());
760747
}
761748

762749
/**
763-
* @inheritdoc
764-
* @param \Magento\CatalogRule\Api\Data\ConditionInterface $condition
765-
* @return $this
750+
* {@inheritdoc}
766751
*/
767752
public function setRuleCondition($condition)
768753
{
@@ -773,84 +758,70 @@ public function setRuleCondition($condition)
773758
}
774759

775760
/**
776-
* @inheritdoc
777-
* @return int|null
761+
* {@inheritdoc}
778762
*/
779763
public function getStopRulesProcessing()
780764
{
781765
return $this->getData(self::STOP_RULES_PROCESSING);
782766
}
783767

784768
/**
785-
* @inheritdoc
786-
* @param int $isStopProcessing
787-
* @return $this
769+
* {@inheritdoc}
788770
*/
789771
public function setStopRulesProcessing($isStopProcessing)
790772
{
791773
return $this->setData(self::STOP_RULES_PROCESSING, $isStopProcessing);
792774
}
793775

794776
/**
795-
* @inheritdoc
796-
* @return int|null
777+
* {@inheritdoc}
797778
*/
798779
public function getSortOrder()
799780
{
800781
return $this->getData(self::SORT_ORDER);
801782
}
802783

803784
/**
804-
* @inheritdoc
805-
* @param int $sortOrder
806-
* @return $this
785+
* {@inheritdoc}
807786
*/
808787
public function setSortOrder($sortOrder)
809788
{
810789
return $this->setData(self::SORT_ORDER, $sortOrder);
811790
}
812791

813792
/**
814-
* @inheritdoc
815-
* @return string
793+
* {@inheritdoc}
816794
*/
817795
public function getSimpleAction()
818796
{
819797
return $this->getData(self::SIMPLE_ACTION);
820798
}
821799

822800
/**
823-
* @inheritdoc
824-
* @param string $action
825-
* @return $this
801+
* {@inheritdoc}
826802
*/
827803
public function setSimpleAction($action)
828804
{
829805
return $this->setData(self::SIMPLE_ACTION, $action);
830806
}
831807

832808
/**
833-
* @inheritdoc
834-
* @return float
809+
* {@inheritdoc}
835810
*/
836811
public function getDiscountAmount()
837812
{
838813
return $this->getData(self::DISCOUNT_AMOUNT);
839814
}
840815

841816
/**
842-
* @inheritdoc
843-
* @param float $amount
844-
* @return $this
817+
* {@inheritdoc}
845818
*/
846819
public function setDiscountAmount($amount)
847820
{
848821
return $this->setData(self::DISCOUNT_AMOUNT, $amount);
849822
}
850823

851824
/**
852-
* Get from date
853-
*
854825
* @return string
855826
*/
856827
public function getFromDate()
@@ -859,8 +830,6 @@ public function getFromDate()
859830
}
860831

861832
/**
862-
* Get to date
863-
*
864833
* @return string
865834
*/
866835
public function getToDate()
@@ -869,7 +838,8 @@ public function getToDate()
869838
}
870839

871840
/**
872-
* @inheritdoc
841+
* {@inheritdoc}
842+
*
873843
* @return \Magento\CatalogRule\Api\Data\RuleExtensionInterface|null
874844
*/
875845
public function getExtensionAttributes()
@@ -878,7 +848,8 @@ public function getExtensionAttributes()
878848
}
879849

880850
/**
881-
* @inheritdoc
851+
* {@inheritdoc}
852+
*
882853
* @param \Magento\CatalogRule\Api\Data\RuleExtensionInterface $extensionAttributes
883854
* @return $this
884855
*/
@@ -888,8 +859,6 @@ public function setExtensionAttributes(RuleExtensionInterface $extensionAttribut
888859
}
889860

890861
/**
891-
* Get rule condition converter
892-
*
893862
* @return Data\Condition\Converter
894863
* @deprecated 100.1.0
895864
*/

0 commit comments

Comments
 (0)