Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Commit

Permalink
Update pitticatrovaprezzi.php
Browse files Browse the repository at this point in the history
  • Loading branch information
luciobenini committed Feb 20, 2021
1 parent 8619660 commit 443d73c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pitticatrovaprezzi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand All @@ -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();
Expand Down

0 comments on commit 443d73c

Please sign in to comment.