Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Want to add code in <head> section in X-Cart 5
 
Reply
   X-Cart forums > X-Cart 5 > Modifying the design and features (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 02-25-2017, 10:24 AM
  Soft-Reseller.com's Avatar 
Soft-Reseller.com Soft-Reseller.com is offline
 

Advanced Member
  
Join Date: Jul 2009
Posts: 68
 

Default Want to add code in <head> section in X-Cart 5

Hello

I am using X-Cart Business V5.3.2.7.
I want to use LiveHelp script who says to add following code in <head></head> section.

Code:
<!-- BEGIN chatstack.com Live Chat HTML Code --> <script type="text/javascript"> var Chatstack = { server: 'chat.soft-reseller.com' }; (function(d, undefined) { // JavaScript Chatstack.e = []; Chatstack.ready = function (c) { Chatstack.e.push(c); } var b = d.createElement('script'); b.type = 'text/javascript'; b.async = true; b.src = ('https:' == d.location.protocol ? 'https://' : 'http://') + Chatstack.server + '/livehelp/scripts/js.min.js'; var s = d.getElementsByTagName('script')[0]; s.parentNode.insertBefore(b, s); })(document); </script> <!-- END chatstack.com Live Chat HTML Code -->

Kindly guide me where I put this code.
Best Regards
Reply With Quote
  #2  
Old 02-26-2017, 10:54 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Want to add code in <head> section in X-Cart 5

You should create a custom module having the following Twig template:
Code:
{## # @ListChild (list="head", weight="5000") #} <!-- BEGIN chatstack.com Live Chat HTML Code --> <script type="text/javascript"> var Chatstack = { server: 'chat.soft-reseller.com' }; (function(d, undefined) { // JavaScript Chatstack.e = []; Chatstack.ready = function (c) { Chatstack.e.push(c); } var b = d.createElement('script'); b.type = 'text/javascript'; b.async = true; b.src = ('https:' == d.location.protocol ? 'https://' : 'http://') + Chatstack.server + '/livehelp/scripts/js.min.js'; var s = d.getElementsByTagName('script')[0]; s.parentNode.insertBefore(b, s); })(document); </script> <!-- END chatstack.com Live Chat HTML Code -->

This should add your custom script into the header part of the page.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 02-26-2017, 11:40 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Want to add code in <head> section in X-Cart 5

You can also add the code on the "Look & Feel" -> "Custom JavaScript" page (but remove the wrapping "script" tag).
Although in this case the code won't go into the "head" part of the page, it still should work.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #4  
Old 01-21-2019, 03:36 PM
 
lostdog9 lostdog9 is offline
 

Member
  
Join Date: May 2014
Location: USA
Posts: 14
 

Default Re: Want to add code in <head> section in X-Cart 5

Hello,

I have used this advice and added the script into the head but it does not seam to render. Does anyone see something wrong here?

<!-- BEGIN schema HTML Code -->
<script src="https://cdn.schemaapp.com/javascript/schemaFunctions.min.js"></script>
<script>schemaLoad("Factory_Direct_Hardware", "YEKJD-0JKCZ-FMEEY-K2LIJ", true);</script>
<script src="https://cdn.schemaapp.com/javascript/highlight.js"></script>
<!-- END schema HTML Code -->
__________________
5.3.5.8
Assigned Products
Backorder / Preorder
Banner System
Bestsellers
Bulk Editing
Catalog
Catalog Subtitles
Category Second Description
Product Feeds
Product Variants
Reply With Quote
  #5  
Old 05-08-2019, 04:55 AM
 
sales@webosusa.com sales@webosusa.com is offline
 

Senior Member
  
Join Date: Nov 2007
Location: Australia
Posts: 118
 

Default Re: Want to add code in <head> section in X-Cart 5

This will sove your issue...
https://market.x-cart.com/addons/custom-header-assets.html
__________________
Pedro
digitalnotions.i2u.shop
shop.modestclassy.com.au4.1.9 X-Cart
X-Cart
Business 5.3.6.0
Multi-vendor 5.3.6.0


Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Modifying the design and features (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:19 PM.

   

 
X-Cart forums © 2001-2018