Page 1 of 1

Add product_id to Schema and Opengraph for Pixels?

Posted: Mon Mar 25, 2024 5:27 am
by lecarlb
Hello,

I was wondering how to add the product id to ht_schema and ht_opengraph mainly for Facebook Pixel?

It's for a 1.0.8.4 shop.

If you need more info, let me know.

I thought it was as simple as adding 'id' => $product_info['products_id'], to ht_schema.php but obviously some supporting code is needed.


Thank you.

Re: Add product_id to Schema and Opengraph for Pixels?

Posted: Mon Mar 25, 2024 9:33 am
by burt
These instructions are for Phoenix 1.0.8.19 and blow.
These instructions are not for 1.0.8.20 onwards, where you can do all this with a hook.

1.0.8.19 and below

For schema I believe it is productID, so;

Code: Select all

$schema_product['productID'] = (int)$product_info['products_id'];
placed just above

Code: Select all

$data = json_encode($schema_product);

--

For opengraph I believe it is product:retailer_item_id, so;

Code: Select all

$data['product:retailer_item_id'] = (int)$product->get('id');
placed just above
$result = '';