Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Where To Add Facebook Messenger Code Snippet Rate Topic   - - - - -

 
  • Valuesbig
  • Senior Member
  • Members
  • Join Date: 05-Jan 20
  • 152 posts

Posted 26 May 2020 - 02:28 PM #1

On our website, Where to add facebook messenger code snippet Thanks Sent from my LND-L29 using Tapatalk

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21996 posts

Posted 27 May 2020 - 07:14 AM #2

What does their instruction say?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • emall
  • Advanced Member
  • Members
  • Join Date: 15-Sep 20
  • 117 posts

Posted 24 October 2020 - 04:22 PM #3

Did you manage to add the code snippet? The instructions received are:

 

Simply paste the code snippet below into your website code. We recommend placing the code after the opening <body> tag on pages where you want the plugin to appear



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21996 posts

Posted 26 October 2020 - 05:13 AM #4

You should use the index:body hook in this case


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • emall
  • Advanced Member
  • Members
  • Join Date: 15-Sep 20
  • 117 posts

Posted 27 October 2020 - 04:16 PM #5

Thank you eCom. I am not sure I understand what you mean though. Can you please be a bit more analytical?



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12073 posts

Posted 27 October 2020 - 06:43 PM #6

Enable the my_changes addon.
Add the file design/themes/responsive/templates/addons/my_changes/hooks/index/body.post.tpl
with the following content:
<script type="text/javascript">
  $(document).ready( function() {
    {literal}
    ADD YOUR CODE HERE
    {/literal}
  });
</script>
Then clear your cache and "inspect" the page to verify that your script code is on your page(s).
 
But given that cs-cart will move all your script code past the footer, there's no reason to use the 'index:body' hook.  You can just as easily use 'index:scripts' which would be more consistent with integrating other scripts into your site.  But both will work.  It's developer's choice.
 
If the messenger code inserts html into the UI in a specific location, then you'll need to add the attribute 'data="no_defer"' to  the script tag and then you should use the 'index:body' hook.  The script tag would then look like:
 
<script data="no_defer" type="text/javascript">
That will prevent cs-cart from moving the script to the bottom of the page and leave it where you've placed it.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21996 posts

Posted 28 October 2020 - 04:58 AM #7

Just small correction. Use the following code to leave your code right after the body tag

 

<script type="text/javascript" data-no-defer>
  $(document).ready( function() {
    {literal}
    ADD YOUR CODE HERE
    {/literal}
  });
</script>

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12073 posts

Posted 28 October 2020 - 04:57 PM #8

Thx for the correction Ecom.  Was working from memory (not always the best) and use the data-no-defer very infrequently (like maybe once in the 5 years it's been around!).


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Connor394
  • Newbie
  • Trial users
  • Join Date: 04-Nov 20
  • 2 posts

Posted 04 November 2020 - 11:48 AM #9

From the left sidebar, click Settings and choose Insert Headers and Footers. Finally, paste the Messenger chat code into your script header and click Save.



 
  • Connor394
  • Newbie
  • Trial users
  • Join Date: 04-Nov 20
  • 2 posts

Posted 05 November 2020 - 09:06 AM #10

From the left sidebar, click here Settings and choose Insert Headers and Footers. Finally, paste the Messenger chat code into your script header and click Save.

Any update???



 
  • emall
  • Advanced Member
  • Members
  • Join Date: 15-Sep 20
  • 117 posts

Posted 06 November 2020 - 08:00 PM #11

Enable the my_changes addon.
Add the file design/themes/responsive/templates/addons/my_changes/hooks/index/body.post.tpl
with the following content:

<script type="text/javascript">
  $(document).ready( function() {
    {literal}
    ADD YOUR CODE HERE
    {/literal}
  });
</script>
Then clear your cache and "inspect" the page to verify that your script code is on your page(s).
 
But given that cs-cart will move all your script code past the footer, there's no reason to use the 'index:body' hook.  You can just as easily use 'index:scripts' which would be more consistent with integrating other scripts into your site.  But both will work.  It's developer's choice.
 
If the messenger code inserts html into the UI in a specific location, then you'll need to add the attribute 'data="no_defer"' to  the script tag and then you should use the 'index:body' hook.  The script tag would then look like:
 
<script data="no_defer" type="text/javascript">
That will prevent cs-cart from moving the script to the bottom of the page and leave it where you've placed it.

 

Thank you. Just one problem... design/themes/responsive/templates/addons/my_changes does not exist. I have enabled the addon but still... Help please :)



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12073 posts

Posted 06 November 2020 - 09:12 PM #12

You need to create the path/file.

But given we have no idea what you're installing, can't advise where to use the data-no-defer attribute or not.

 

Suggest you read the development documentation if you're going to play developer....  https://docs.cs-cart...uide/index.html


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21996 posts

Posted 09 November 2020 - 04:17 AM #13

Thank you. Just one problem... design/themes/responsive/templates/addons/my_changes does not exist. I have enabled the addon but still... Help please :)

 

@tbirnseth is right. You should create path and file


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • CourtStreet
  • Newbie
  • Trial users
  • Join Date: 10-Feb 21
  • 2 posts

Posted 13 February 2021 - 04:07 AM #14

From the left sidebar, click Settings and choose Insert Headers and Footers. Finally, paste the Messenger chat code into your script header and click Save.



 
  • emall
  • Advanced Member
  • Members
  • Join Date: 15-Sep 20
  • 117 posts

Posted 23 March 2021 - 07:32 PM #15

From the left sidebar, click Settings and choose Insert Headers and Footers. Finally, paste the Messenger chat code into your script header and click Save.

Which sidebar are you referring to?