From 443d73ca33cee903afc2c4553f14df297c9e907e Mon Sep 17 00:00:00 2001 From: Lucio Benini Date: Sat, 20 Feb 2021 20:06:16 +0100 Subject: [PATCH] Update pitticatrovaprezzi.php --- pitticatrovaprezzi.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pitticatrovaprezzi.php b/pitticatrovaprezzi.php index 3e4f83e..90efb38 100644 --- a/pitticatrovaprezzi.php +++ b/pitticatrovaprezzi.php @@ -289,6 +289,8 @@ public function updateProducts() $cover = ''; } + $ean = empty($attribute['ean13']) ? $product->ean13 : $attribute['ean13']; + $offer = new TrovaprezziOffer(); $offer->id_product = $product->id; $offer->id_product_attribute = (int) $attribute['id_product_attribute']; @@ -304,8 +306,8 @@ public function updateProducts() $offer->image_2 = !empty($images[1]) ? $images[1] : ''; $offer->image_3 = !empty($images[2]) ? $images[2] : ''; $offer->shipping_cost = $cart->getPackageShippingCost($carrier, true, $country); - $offer->part_number = empty($attribute['reference']) ? $attribute['ean13'] : $attribute['reference']; - $offer->ean_code = $attribute['ean13']; + $offer->part_number = empty($attribute['reference']) ? $ean : $attribute['reference']; + $offer->ean_code = $ean; $offer->weight = (float) $attribute['weight'] + (float) $product->weight; $offer->active = $product->active; $offer->add();