[Skip to main content](#vessel-content)

#   Pinterest Integration

##

- **[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")**
- [![bigfoot's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7488-bigfoot "View bigfoot's Profile") Topic Author
- [ Offline](/forum/user/7488-bigfoot)

Less More

- Posts: 255
- Thank you received: 2
-
-

4 years 8 months ago [\#340206](#340206) by [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")  *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#340206 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")* was created by *[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")*

-- url of the page with the problem -- : [ www.beeswaxcandleshop.com/store.html](https://www.beeswaxcandleshop.com/store.html)
-- HikaShop version -- : 4.5.0
-- Joomla version -- : 3.10.6
-- PHP version -- : 7.4.28
-- Browser(s) name and version -- : chrome

I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add "add to cart", "checkout" and "page visit" to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

4 years 8 months ago [\#340211](#340211) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#340211 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Hi,

Go in the menu Display&gt;Views of HikaShop. There edit the file product / show for your frontend template and you can add your javascript in there.

The following user(s) said Thank You: [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")**
- [![bigfoot's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7488-bigfoot "View bigfoot's Profile") Topic Author
- [ Offline](/forum/user/7488-bigfoot)

Less More

- Posts: 255
- Thank you received: 2
-
-

4 years 8 months ago [\#340247](#340247) by [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")  Replied by *[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#340247 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Thank you - It worked fine and the code is in all of the hikashop product files - however I will need to put code into each separate product files. I am trying to use "sourceror" and it works fine in a non hikashop article but when I use it in a hikashop product description article, all the "code" parts gets stripped out after saving and refreshing. Is there any setting in hikashop to change this?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

4 years 8 months ago [\#340250](#340250) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#340250 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Hi,

I don't think there is anything in HikaShop which does that for the product description. It's probably your HTML editor.
In the HikaShop configuration, you can change the "editor" setting to "none" to get a normal textarea instead of the HTML editor. That way you'll be able to check if it works like that, which would confirm it comes from the HTML editor, and maybe it has a setting to toggle to allow for that.
Alternatively, you can also create a custom field of the table "product" with ti's "input filtering" setting turned off via the menu Display&gt;custom fields to add your code, and then in the product / show view file, you can use such code:
&lt;?php echo $this-&gt;element-&gt;xxx; ?&gt;
where xxx is the column name of the custom field.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")**
- [![bigfoot's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7488-bigfoot "View bigfoot's Profile") Topic Author
- [ Offline](/forum/user/7488-bigfoot)

Less More

- Posts: 255
- Thank you received: 2
-
-

4 years 8 months ago [\#340252](#340252) by [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")  Replied by *[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#340252 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Thank you - It worked fine!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")**
- [![bigfoot's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7488-bigfoot "View bigfoot's Profile") Topic Author
- [ Offline](/forum/user/7488-bigfoot)

Less More

- Posts: 255
- Thank you received: 2
-
-

4 years 8 months ago -  4 years 8 months ago [\#340336](#340336) by [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")  Replied by *[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#340336 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Back with another quick similar question. I have two more pieces of code to insert in "add to cart" and "checkout". So it triggers when a customer from pinterest checks out.

I have added them to:
"cart / showcart.php" and "checkout / show.php" -- I do not think it is working correctly and cannot see them in source file.

Is this the best spot?

"sample" Code:

&lt;script&gt; pintrk('track', 'checkout', { value: 100, order_quantity: 1, currency: 'USD', line_items: [ { product_id: {{ product.id }} } ] }); &lt;/script&gt;

Last edit: 4 years 8 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

4 years 8 months ago [\#340347](#340347) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#340347 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Hi,

If you want to add javascript code on the checkout, you can indeed add it in the checkout / show view file.
I actually do see your javascript code on the checkout page on your website:
[ i.imgur.com/IDJwjCY.png](https://i.imgur.com/IDJwjCY.png)

The following user(s) said Thank You: [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")**
- [![bigfoot's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7488-bigfoot "View bigfoot's Profile") Topic Author
- [ Offline](/forum/user/7488-bigfoot)

Less More

- Posts: 255
- Thank you received: 2
-
-

4 years 3 weeks ago [\#346300](#346300) by [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")  Replied by *[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#346300 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Hello - I am back again and still working on Pinterest integration. I have added a custom field to add code and it is working. However it is on the bottom of the body and I need it on the bottom of the HEAD area. It would be a slightly different code for each product. Is there a way to have a custom field for each product IN THE HEAD AREA?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

4 years 3 weeks ago [\#346305](#346305) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#346305 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Hi,

You can. For that, instead of directly writing your Javascript code inside script tags, you want to use the addScriptDeclaration method of Joomla:
[ docs.joomla.org/Adding\_JavaScript](https://docs.joomla.org/Adding_JavaScript)
This method will add the script tags around your JS code and will add all that to the bottom of the head tag of the page.

The following user(s) said Thank You: [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")**
- [![bigfoot's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7488-bigfoot "View bigfoot's Profile") Topic Author
- [ Offline](/forum/user/7488-bigfoot)

Less More

- Posts: 255
- Thank you received: 2
-
-

4 years 3 weeks ago [\#346306](#346306) by [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")  Replied by *[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#346306 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Thank you - I will check it out. Where do I paste in the script - In my new extra field I made, or somewhere else? Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

4 years 2 weeks ago [\#346308](#346308) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#346308 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Hi,

In a previous message ( [ www.hikashop.com/forum/integrations/9041...egration.html#340336](https://www.hikashop.com/forum/integrations/904134-pinterest-integration.html#340336) ), you said that you had added your javascript code to "cart / showcart.php" and "checkout / show.php".
So I was thinking you would use an addScriptDeclaration call in these.

The following user(s) said Thank You: [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")**
- [![bigfoot's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7488-bigfoot "View bigfoot's Profile") Topic Author
- [ Offline](/forum/user/7488-bigfoot)

Less More

- Posts: 255
- Thank you received: 2
-
-

4 years 2 weeks ago [\#346311](#346311) by [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")  Replied by *[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#346311 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Hello - I am a bit confused, I do not write code - just do a lot of copy/paste. (and pinterest does not help a lot to get everything working)

I previously put this code (below)in "cart / showcart.php" page and it shows up at the bottom of page source just fine, but it needs to be in the head. So now I need to use the addScriptDeclaration as you suggested.

&lt;script&gt;
pintrk('track', 'addtocart', {
value: 10.00,
order_quantity: 1,
currency: 'USD'
});
&lt;/script&gt;

I am not exactly sure how to implement it. Trying to learn a few new things - I found this below:

Inline JavaScript

Blocks of JavaScript code can be declared directly within a component or module's display template using the JDocument class' addScriptDeclaration method:
&#96;&#96;&#96;
&lt;?php
$document = JFactory::getDocument();
$document-&gt;addScriptDeclaration('
window.event("domready", function() {
alert("An inline JavaScript Declaration");
});
');
?&gt;
&#96;&#96;&#96;

Question1 - So I need to put this code in my "cart / showcart.php" page. Where do I put the script, Inside the brackets?

&lt;?php
$document = JFactory::getDocument();
$document-&gt;addScriptDeclaration('
window.event("domready", function() {
alert("An inline JavaScript Declaration");
});
');
?
&lt;script&gt;
pintrk('track', 'addtocart', {
value: 10.00,
order_quantity: 1,
currency: 'USD'
});
&lt;/script&gt;&gt;

I am a bit lost here - or do I put it somewhere else in my template and point to it???
+++++++

Question 2 - Here is a script commonly used in pinterest:
&lt;script&gt;
pintrk('track', 'pagevisit', {
line_items: [
{
product_id: {{ product.id }}
}
]
});
&lt;/script&gt;

This part:
"product_id: {{ product.id }}"
will this automatically pull my hikashop product id and use it ? - at one time I was thinking I had to add this code with my actual product id pasted in - such as "product_id: {{ lp_3cyl }}" - I think this is incorrect?

Last Question/comment - I do not see a lot of info about using Pinterest with Hikashop - lots of stuff with Shopify and other systems. I really would like to see Hikashop playing nice with Pinterest - It would add value to Hikashop and their users. If you have any other links regarding Pinterest integration, please let me know.

Thank you for answering all my uninformed questions.

Bill

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

4 years 2 weeks ago [\#346314](#346314) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#346314 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Hi,

If you've added the code: Code:

&lt;script&gt; pintrk('track', 'addtocart', { value: 10.00, order_quantity: 1, currency: 'USD' }); &lt;/script&gt;

somewhere on a Joomla website in a PHP file and you want that JS code to be in the header of the page, then you can replace it by : Code:

$document = JFactory::getDocument(); $document-&gt;addScriptDeclaration(" pintrk('track', 'addtocart', { value: 10.00, order_quantity: 1, currency: 'USD' }); ");

This won't replace dynamically the data from the the products on the page.

In order to track everything (products, carts, orders), it requires the development of a plugin with hundreds of lines of code, similarly to what we did with the GA4 and Matomo plugins on our marketplace.
It's possible, but it's not something I can do for you here and if you're not familiar with PHP, you won't be able to do it either.

The following user(s) said Thank You: [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")**
- [![bigfoot's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7488-bigfoot "View bigfoot's Profile") Topic Author
- [ Offline](/forum/user/7488-bigfoot)

Less More

- Posts: 255
- Thank you received: 2
-
-

4 years 2 weeks ago -  4 years 2 weeks ago [\#346361](#346361) by [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")  Replied by *[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#346361 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

I added this code:
$document = JFactory::getDocument();
$document-&gt;addScriptDeclaration("
pintrk('track', 'addtocart', {
value: 10.00,
order_quantity: 1,
currency: 'USD'
});
");

to the bottom of this page:
[ www.beeswaxcandleshop.com/cart/checkout.html](https://www.beeswaxcandleshop.com/cart/checkout.html)
Looking at the page source, I see it in the bottom of the body, but not in the head where I want it - Did I do something wrong?
(I must have - I am seeing this code in bottom of live checkout page - oops)

Last edit: 4 years 2 weeks ago by [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile"). Reason: more info

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

4 years 2 weeks ago [\#346367](#346367) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#346367 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Hi,

You need to add PHP tags around your PHP code: Code:

&lt;?php $document = JFactory::getDocument(); $document-&gt;addScriptDeclaration(" pintrk('track', 'addtocart', { value: 10.00, order_quantity: 1, currency: 'USD' }); "); ?&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")**
- [![bigfoot's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7488-bigfoot "View bigfoot's Profile") Topic Author
- [ Offline](/forum/user/7488-bigfoot)

Less More

- Posts: 255
- Thank you received: 2
-
-

4 years 2 weeks ago [\#346451](#346451) by [bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")  Replied by *[bigfoot](/forum/user/7488-bigfoot "View bigfoot's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#346451 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Thank you - that made it work. Another slight problem - I have a main pinterest tag added on ALL my pages through my template (shows at bottom of head) - Now the new script is showing above the main pinterest tag and it needs to be at the bottom - should I just put another copy of main pinterest tag in with the newly added one? The main pint tag needs to fire before the add to cart one.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

4 years 2 weeks ago [\#346456](#346456) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Pinterest Integration](/forum/30-integrations/904134-pinterest-integration#346456 "-- url of the page with the problem -- :   www.beeswaxcandleshop.com/store.html  -- HikaShop version -- : 4.5.0 -- Joomla version -- : 3.10.6 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : chrome  I am working to integrate Pinterest and Hikashop. I have added their base code to the head of the site just fine. Now I need to add &quot;add to cart&quot;, &quot;checkout&quot; and &quot;page visit&quot; to the site. I THINK I need to add it to each product page. Howe do I add script to each product page?")*

Hi,

What you could do then is to use this code: Code:

&lt;?php $document = JFactory::getDocument(); $document-&gt;addScriptDeclaration(" window.hikashop.ready(function(){ pintrk('track', 'addtocart', { value: 10.00, order_quantity: 1, currency: 'USD' }); }); "); ?&gt;

That way, the pintrk function will only be called once the page is fully loaded, and the JS of the template should have been executed by then.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQxMzQtcGludGVyZXN0LWludGVncmF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.094 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
