@@ -122,9 +122,10 @@ public function extendProductParseResult(LoopExtendsParseResultsEvent $event)
122
122
/** @var \Thelia\Model\Product | \Thelia\Model\ProductSaleElements $product */
123
123
$ product = $ loopResultRow ->model ;
124
124
125
- if (!empty ($ product ->getVirtualColumn ('CUSTOMER_FAMILY_PRICE ' )) ||
126
- !empty ($ product ->getVirtualColumn ('CUSTOMER_FAMILY_PROMO_PRICE ' ))
127
- ) {
125
+ $ customerFamilyPriceVirtualColumn = $ product ->getVirtualColumn ('CUSTOMER_FAMILY_PRICE ' );
126
+ $ customerFamilyPromoPriceVirtualColumn = $ product ->getVirtualColumn ('CUSTOMER_FAMILY_PROMO_PRICE ' );
127
+
128
+ if (!empty ($ customerFamilyPriceVirtualColumn ) || !empty ($ customerFamilyPromoPriceVirtualColumn )) {
128
129
$ this ->changeProductPrice (
129
130
$ product ,
130
131
$ loopResultRow ,
@@ -211,7 +212,8 @@ protected function changeProductPrice(
211
212
$ taxedPromoPrice = $ loopResultRow ->get ('TAXED_PROMO_PRICE ' );
212
213
213
214
// Replace price
214
- if (!empty ($ product ->getVirtualColumn ('CUSTOMER_FAMILY_PRICE ' ))) {
215
+ $ customerFamilyPriceVirtualColumn = $ product ->getVirtualColumn ('CUSTOMER_FAMILY_PRICE ' );
216
+ if (!empty ($ customerFamilyPriceVirtualColumn )) {
215
217
$ price = round ($ product ->getVirtualColumn ('CUSTOMER_FAMILY_PRICE ' ), 2 );
216
218
217
219
// If the customer has permanent discount, apply it
@@ -242,7 +244,8 @@ protected function changeProductPrice(
242
244
}
243
245
244
246
// Replace promo price
245
- if (!empty ($ product ->getVirtualColumn ('CUSTOMER_FAMILY_PROMO_PRICE ' ))) {
247
+ $ customerFamilyPromoPriceVirtualColumn = $ product ->getVirtualColumn ('CUSTOMER_FAMILY_PROMO_PRICE ' );
248
+ if (!empty ($ customerFamilyPromoPriceVirtualColumn )) {
246
249
$ promoPrice = round ($ product ->getVirtualColumn ('CUSTOMER_FAMILY_PROMO_PRICE ' ), 2 );
247
250
248
251
// If the customer has permanent discount, apply it
0 commit comments