X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   4.1.x MaxCDN and Detailed Products (https://forum.x-cart.com/showthread.php?t=68196)

jriggins911 11-21-2013 10:01 PM

4.1.x MaxCDN and Detailed Products
Anyone know how to get MaxCDN working on 4.1.x for detailed product images?

Here are the specifics of what we're using.

We have it working for thumbnail images. (Made the modifications to the smarty.php and /inlcude/func/func.files.php)

We have the built-in Detailed product listings turned on.

Problem is, on the product page, the thumbnail is pulled from the cdn, but the detailed images are still going through the javascript and the /popup_image.php?type=D&id= process.

If I change the func.files.php file to include type 'D' instead of type 'P' AND disable javascript, the detailed product images will pull from the cdn.

Using the javascript enabled version of our xcart, and the images are still going the the pop_image function.

Anyone got the detailed product images pulling from maxcdn on 4.1.x?


// WCM - CDN Images
if (($type == 'T' OR $type == 'P') AND $_SERVER['HTTPS'] != 'on')
$image_path = str_replace('/home/DirectoryName/public_html/images/','http://xxx.yyy.com/',$image_path);
return str_replace('$http_location','',$image_path);
// / WCM - CDN Images


// WCM - MaxCDN Implementation
if ($_SERVER['HTTPS'] != 'on')


In the Detailed images config, we have the popup options enabled. If I turn that off and set the func/func.files.php to include type 'D' files, everything pulls fine from the CDN.

With the popup enabled on the detailed product images, it goes through javascript and not the cdn


jriggins911 11-22-2013 07:25 AM

Re: 4.1.x MaxCDN and Detailed Products

Having worked a lot on this in the overnight hours, I found that if the type == 'D' option is included in the include/func/func.files.php file, the pictures are indeed written to be pulled from the CDN--they still go through the popup_image file because of the "display detailed images in a popup window' option in the config settings of the detailed images module.

One observation, as at least on other user noted, is that the CPU util on the server goes up when these types are included.

So a point of clarification is that the type D files can be included in the func files and it will write the img src to pull from your CDN.

In case anyone was wanting to know...I know a couple of the threads it was a little unclear on exactly if the detailed images could be farmed to a CDN.

The next goals are:

1. To be able to do so without incurring extra cycles on the server.

2. Nail down if pulling the type D pictures is legitimately causing an increase.

3. Getting the related pictures thumbnails, as listed on the product page, to pull from the cdn. This looks like it is going to be a hot mess because the related product pictures are sent through the image.php functions with pass by value variables (product id and image type). There may not be a good (read: easy and not having to rewrite a lot of code) way to do this.

If anyone has any ideas on any of this....let me know. (There's got to be at least a few people who are still entrenched in the 4.1.x branch)

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

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.