• Resolved benir

    (@benir)


    Hi, so the pixel is working smoothly but one issue that is bugging me is when I add a product an it syncs to the facebook catalogue it shows the price excluding VAT for example if a product is £60 including VAT it would be £50 on the catalogue this applies to all of my products. only when entering manually on facebook I can get the accurate price. this way is too time consuming.

    thank you

Viewing 15 replies - 1 through 15 (of 20 total)
  • Same issue. Following.

    EDIT:

    Found setting under product catalogue – edit feed url – special mapping – price – including taxes

    • This reply was modified 3 years, 11 months ago by Robothead.
    Plugin Author Antonino Scarfì

    (@antoscarface)

    Yes @toktor ! Thank you for reporting the option you mentioned, I added this recently in order to give you ability to decide if you want the prices included or excluded taxes 🙂

    Thread Starter benir

    (@benir)

    GAME CHANGER THANK YOU FOR ADDING THIS

    Plugin Author Antonino Scarfì

    (@antoscarface)

    You’re welcome! Really happy you solved your issue! 🙂

    If you need further help, don’t hesitate to open a new topic.

    If you love the plugin, please share your experience with Pixel Caffeine from here, it would be much appreciated! 🙂

    Have a nice day!

    hello

    what if woocommerce VAT settings is setup to display prices with VAT or without VAT depending on user location (geolocating them) and not by store location? in this case that option is not working and prices in the feed beeing generated without VAT. is there any workaround for this?

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    unfortunately, it’s not possible to set a geolocalization in the Product Catalog, because you cannot set in Facebook Product Feed different prices matrix depending on geolocalization.

    i see, but maybe there’s a way to forcibly add +20% VAT for all the prices in the feed?

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    you may do that by adding a little hook in the code. Here it is:

    
    add_filter('aepc_feed_item', function($fields, $item) {
    	$product_id = $item->get_id();
    	
    	// EDIT HERE
    	$fields['g:price'] = $fields['g:price'] + $fields['g:price'] * 0.2;
    	// END EDIT HERE
    	
    	return $fields;
    }, 10, 2);
    
    

    You can add this hook at the end of functions.php file of your current theme or in a new plugin.

    thanks Antonino, i’ll try that.

    well, unfortunetelly this code strips currency symbol from feed:

    <g:price>57.5 GBP</g:price>
    becomes
    <g:price>69</g:price>

    any thoughts?

    Plugin Author Antonino Scarfì

    (@antoscarface)

    You’re right, sorry my bad.

    Here the fixed version:

    
    add_filter('aepc_feed_item', function($fields, $item) {
        /** @var \PixelCaffeine\ProductCatalog\FeedMapper $item */
        $product_id = $item->get_id();
    
        // EDIT HERE
        $price = floatval(trim(str_replace($item->get_currency(), '', $item->get_price())));
        $fields['g:price'] = ( $price + $price * 0.2 ) . ' ' . $item->get_currency();
        // END EDIT HERE
    
        return $fields;
    }, 10, 2);
    

    It restores the currency inside the price param.
    Let me know.

    ok, i’ll try, just one more question – what about sale price? i see it in the feed as well if product has it defined. i guess i need to add similar calc line?

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Yes correct, here it is:

    
    add_filter('aepc_feed_item', function($fields, $item) {
    	/** @var \PixelCaffeine\ProductCatalog\FeedMapper $item */
    	$product_id = $item->get_id();
    
    	// EDIT HERE
    	$price = floatval(trim(str_replace($item->get_currency(), '', $item->get_price())));
    	$fields['g:price'] = ( $price + $price * 0.2 ) . ' ' . $item->get_currency();
    	$salePrice = floatval(trim(str_replace($item->get_currency(), '', $item->get_sale_price())));
    	$fields['g:sale_price'] = ( $salePrice + $salePrice * 0.2 ) . ' ' . $item->get_currency();
    	// END EDIT HERE
    
    	return $fields;
    }, 10, 2);
    

    thanks a lot, i’ll try it.

    the code works, but it adds sale_price with 0 GBP value if product doesn’t have sale price defined. i guess it needs some “if” statement to print sale_price tag conditionally.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Price shown on facebook catalogue is showing without the VAT’ is closed to new replies.