Support » Plugin: Pixel Caffeine » Product Catalog generates bad checkout_url

  • Hi, I’ve just realized that your plugin generates bad checkout_url that goes to https://domain.com/add-to-cart and it doesn’t add product to the cart.

    I needed to use Facebook for Woocommerce to make it properly. However I really like your plugin and would really like to generate product feeds using it.

    Are you able to fix it or send me a solution?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    thanks for reporting this, I’ll add into the fixes list for the next release.

    In meanwhile, you can fix by adding this code snippet at the end of the functions.php file of your active theme or in a new one-file WP plugin:

    add_filter('aepc_feed_item', function($fields, $item){
    	$product = wc_get_product($item->get_id());
    	if ($product) {
    		$fields['g:checkout_url'] = $product->add_to_cart_url();
    	}
    	return $fields;
    });

    In this way, you will change the checkout_url value setting the add to cart URL of the product.

    Let me know if it can help you.
    Thanks.

    the checkout_url should be the actual product url…doesn’t make sense to me to get the product directly added to your cart or at least it might be super confusing to visitors. Also this won’t work with most of the woocommerce websites as in my case. I had to manually change in the code to the actual product link. There should be an option to choose what the checkout url should be because when uploaded in facebook, products take visitors to empty checkout page or empty cart.

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    please upgrade the plugin to the latest version 2.0.5 that I released today, it should fix this issue! 🙂

    Let me know if it solves.
    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Product Catalog generates bad checkout_url’ is closed to new replies.