X-Cart

This article will guide you through the steps necessary to configure your X-Cart site to integrate with our CDNs. To do this, we will simply need to create a pull zone and then replace two lines of code in your smarty.php file.

Step #1 – Creating a Pull Zone for Your Site:

Step #2 – Configuring your X-Cart Install to Use Your Pull Zone:

  • Open the file smarty.php (a core X-Cart file)
  • Find the following two lines
    $smarty->assign("SkinDir",$xcart_web_dir."/skin1");
    $smarty->assign("ImagesDir",$xcart_web_dir."/skin1/images");
  • Surround them with the following if-else statement:
    if ($_SERVER['HTTPS'] != 'on') {
        $smarty->assign("SkinDir","http://CdnUrl.example.com/skin1");
        $smarty->assign("ImagesDir","http://CdnUrl.example.com/skin1/images");
    } else {
        $smarty->assign("SkinDir",$xcart_web_dir."/skin1");
        $smarty->assign("ImagesDir",$xcart_web_dir."/skin1/images");
    }
  • Be sure that you replace “CdnUrl.example.com” with either the temporary URL for your pull zone that we provided you or with the CNAME you created if you decided to do so.