Cs Cart Micro Data Google Feed

My google shopping feed diagnostics is showing the error as below and it seems they are all due to the price being pulled form the price WITHOUT tax, and it should include the tax

And idea where I start to look to try and fix

Thx John

Automatic item updates: Incorrect microdata price information

http://prntscr.com/cpr5tv

http://prntscr.com/cpr6tz

/design/themes/responsive/templates/addons/seo/hooks/products/view_main_info.pre.tpl

Replace:


with


        

Done, thanks guys

Replace:


with


Hi

How would I do this with my_addons to prevent it being overwritten by system updates?

Thanks

Lee

Hi

Sorry after posting this I also found the template has been completely updated since 4.3.5 I think

This is the original now


I've used the same price variable from the original code above, so not sure if there is a new snippet.price code including tax?

Again I'd still welcome any suggestion on making this update proof

Thanks

Lee

Snippet price is calculated in the following file:

app/addons/seo/func.php

But the fn_seo_get_product_data_post function does not have any hooks

So you can use the get_product_data_post in your addon to override this data. Just pay attention to the addon priority

So yes I had to adjust seo/func.php to taxed_price..

        if (isset($product_data['price'])) {
            // Discount might be applied to the original price
            $price = fn_format_price((float) $product_data['taxed_price']);
            $product_data['seo_snippet']['price'] = $price;
        }

Surely such code modifications should not be necessary CS Cart?

Replace:
if (!empty($product_data['price'])) {
$offer['price'] = fn_format_price_by_currency(
$product_data['price'],
CART_PRIMARY_CURRENCY,
$currency
);
with
if (!empty($product_data['price'])) {
$offer['price'] = fn_format_price_by_currency(
$product_data['taxed_price'],
CART_PRIMARY_CURRENCY,
$currency
);

Have just had to do this on a new install (code has changed), however this only works for products that do not have variants - products that are variants do not take into account tax or promotions? :confused:

Replace:
if (!empty($product_data['price'])) {
$offer['price'] = fn_format_price_by_currency(
$product_data['price'],
CART_PRIMARY_CURRENCY,
$currency
);
with
if (!empty($product_data['price'])) {
$offer['price'] = fn_format_price_by_currency(
$product_data['taxed_price'],
CART_PRIMARY_CURRENCY,
$currency
);