X-Cart CDN Integration
This X-Cart CDN integration tutorial shows how to complete a CDN integration with KeyCDN.
For this X-Cart CDN Integration tutorial we're using the default skin called ideal_comfort. If you are using another skin you will need to modify the code shown below to match the name of your skin.
This tutorial works with X-Cart 4.4.x and later (fixed path to skin).
Create a Pull Zone before you start with the X-Cart CDN integration.
Go to the root directory of X-Cart and create a backup of the core X-Cart file
smarty.php
.Open the core X-Cart file
smarty.php
. Search for the following lines:$smarty->assign('ImagesDir', $xcart_web_dir . $smarty_skin_dir . '/images'); $smarty->assign('SkinDir', $xcart_web_dir . $smarty_skin_dir);
Two lines need to be replaced with your CDN URL (e.g.
https://example-hexid.kxcdn.com
):// KeyCDN Integration if ($_SERVER['HTTPS'] != 'on') { $smarty->assign("SkinDir","https://example-hexid.kxcdn.com/skin/ideal_comfort"); $smarty->assign("ImagesDir","https://example-hexid.kxcdn.com/s/skin/ideal_comfort/images"); } else { $smarty->assign("SkinDir",$xcart_web_dir."/skin/ideal_comfort"); $smarty->assign("ImagesDir",$xcart_web_dir."/skin/ideal_comfort/images"); }
Save the changes.
Check in the HTML to see if the URL has been rewritten properly.