Skip to content

Commit

Permalink
correct precision constant
Browse files Browse the repository at this point in the history
Fix for prices missing in versions older than 1.6.1.X
  • Loading branch information
Casper-O committed Feb 18, 2018
1 parent 0def7b4 commit 2bcfa3b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gshoppingflux/gshoppingflux.php
Original file line number Diff line number Diff line change
Expand Up @@ -2432,8 +2432,8 @@ private function getItemXML($product, $lang, $id_curr, $id_shop, $combination =
$no_tax = (!$use_tax ? true : false);
$product['price'] = (float) $p->getPriceStatic($product['id_product'], $use_tax, $combination) * $currency->conversion_rate;
$product['price_without_reduct'] = (float) $p->getPriceWithoutReduct($no_tax, $combination) * $currency->conversion_rate;
$product['price'] = $product['price'] = Tools::ps_round($product['price'], _PS_PRICE_COMPUTE_PRECISION_);
$product['price_without_reduct'] = Tools::ps_round($product['price_without_reduct'], _PS_PRICE_COMPUTE_PRECISION_);
$product['price'] = $product['price'] = Tools::ps_round($product['price'], _PS_PRICE_DISPLAY_PRECISION_);
$product['price_without_reduct'] = Tools::ps_round($product['price_without_reduct'], _PS_PRICE_DISPLAY_PRECISION_);
if ((float) ($product['price']) < (float) ($product['price_without_reduct'])) {
$xml_googleshopping .= '<g:price>'.$product['price_without_reduct'].' '.$currency->iso_code.'</g:price>'."\n";
$xml_googleshopping .= '<g:sale_price>'.$product['price'].' '.$currency->iso_code.'</g:sale_price>'."\n";
Expand Down Expand Up @@ -2565,9 +2565,9 @@ private function getItemXML($product, $lang, $id_curr, $id_shop, $combination =
$xml_googleshopping .= '<g:shipping>' . "\n";
$xml_googleshopping .= "\t" . '<g:country>' . $this->module_conf['shipping_country'] . '</g:country>' . "\n";
$xml_googleshopping .= "\t" . '<g:service>Standard</g:service>' . "\n";
$xml_googleshopping .= "\t" . '<g:price>' . Tools::ps_round($this->module_conf['shipping_price'], _PS_PRICE_COMPUTE_PRECISION_) . ' ' . $currency->iso_code . '</g:price>' . "\n";
$xml_googleshopping .= "\t" . '<g:price>' . Tools::ps_round($this->module_conf['shipping_price'], _PS_PRICE_DISPLAY_PRECISION_) . ' ' . $currency->iso_code . '</g:price>' . "\n";
$xml_googleshopping .= '</g:shipping>' . "\n";
} else if ($this->module_conf['shipping_mode'] == 'full' && count($this->module_conf['shipping_countries[]'])) {
} elseif ($this->module_conf['shipping_mode'] == 'full' && count($this->module_conf['shipping_countries[]'])) {
// Init Cart for calculate shipping costs
$cart = new Cart();
$cart->id_currency = $this->context->currency->id;
Expand Down Expand Up @@ -2612,7 +2612,7 @@ private function getItemXML($product, $lang, $id_curr, $id_shop, $combination =
$xml_googleshopping .= '<g:shipping>' . "\n";
$xml_googleshopping .= "\t" . '<g:country>' . $country['iso_code'] . '</g:country>' . "\n";
$xml_googleshopping .= "\t" . '<g:service>' . $shipping['delay'] . '</g:service>' . "\n";
$xml_googleshopping .= "\t" . '<g:price>' . Tools::ps_round($shipping['price'], _PS_PRICE_COMPUTE_PRECISION_) . ' ' . $currency->iso_code . '</g:price>' . "\n";
$xml_googleshopping .= "\t" . '<g:price>' . Tools::ps_round($shipping['price'], _PS_PRICE_DISPLAY_PRECISION_) . ' ' . $currency->iso_code . '</g:price>' . "\n";
$xml_googleshopping .= '</g:shipping>' . "\n";
}
}
Expand Down

0 comments on commit 2bcfa3b

Please sign in to comment.