@@ -116,21 +116,31 @@ public function postSubmit(FormEvent $event)
116116 $ assembledPriceList ->getDefaultPrice ()
117117 ->setType ($ this ->getPriceType (PriceTypeInterface::DEFAULT_PRICE ))
118118 ->setCurrency ($ assembledPriceList ->getCurrency ());
119+
120+ /** Restores currency in case if product price exists */
121+ if ($ assembledPriceList ->getSpecialPrice () !== null ) {
122+ $ assembledPriceList ->getSpecialPrice ()
123+ ->setType ($ this ->getPriceType (PriceTypeInterface::SPECIAL_PRICE ))
124+ ->setCurrency ($ assembledPriceList ->getCurrency ());
125+ }
126+
127+ /** Removes product price from price list in case if user clear its value */
119128 if ($ assembledPriceList ->getSpecialPrice () !== null &&
120129 $ assembledPriceList ->getSpecialPrice ()->getValue () === null ) {
121130 $ assembledPriceList ->setSpecialPrice (null );
122- } elseif ($ assembledPriceList ->getSpecialPrice () !== null ) {
123- $ assembledPriceList ->getSpecialPrice ()
124- ->setType ($ this ->getPriceType (PriceTypeInterface::SPECIAL_PRICE ))
131+ }
132+
133+ /** Restores currency in case if product price exists */
134+ if ($ assembledPriceList ->getMsrpPrice () !== null ) {
135+ $ assembledPriceList ->getMsrpPrice ()
136+ ->setType ($ this ->getPriceType (PriceTypeInterface::MSRP_PRICE ))
125137 ->setCurrency ($ assembledPriceList ->getCurrency ());
126138 }
139+
140+ /** Removes product price from price list in case if user clear its value */
127141 if ($ assembledPriceList ->getMsrpPrice () !== null &&
128142 $ assembledPriceList ->getMsrpPrice ()->getValue () === null ) {
129143 $ assembledPriceList ->setMsrpPrice (null );
130- } elseif ($ assembledPriceList ->getMsrpPrice () !== null ) {
131- $ assembledPriceList ->getMsrpPrice ()
132- ->setType ($ this ->getPriceType (PriceTypeInterface::MSRP_PRICE ))
133- ->setCurrency ($ assembledPriceList ->getCurrency ());
134144 }
135145 }
136146
0 commit comments