dsnegi Posted March 5, 2015 Share Posted March 5, 2015 Hello, Does any person had a problem where the modules in prestashop doesn't load from CDN? All others images/css/js everything is loading fine except modules and themes. Thanks in advance. Dinesh 1 Link to comment Share on other sites More sharing options...
Dh42 Posted March 5, 2015 Share Posted March 5, 2015 Is the path correct? Link to comment Share on other sites More sharing options...
dsnegi Posted March 5, 2015 Author Share Posted March 5, 2015 Well, I believe so because it's just not taking the cdn path. Is there any special settings we need to do so that it can pickup cdn.mydomain.com instead of mydomain.com? Link to comment Share on other sites More sharing options...
Dh42 Posted March 5, 2015 Share Posted March 5, 2015 Have you entered the cdn path in the media server area? Are you talking about default Prestashop modules or 3rd party purchased ones? Link to comment Share on other sites More sharing options...
bellini13 Posted March 5, 2015 Share Posted March 5, 2015 All others images/css/js everything is loading fine except modules and themes. Can you be more specific? What module and theme files are you expecting to load in the CDN? Give a specific example Link to comment Share on other sites More sharing options...
doekia Posted March 5, 2015 Share Posted March 5, 2015 Module? you mean images,css,js from the module or something else? A module or template is code ... code cannot be loaded from CDN per design à CDN only delivers static content Link to comment Share on other sites More sharing options...
thejustme Posted March 13, 2015 Share Posted March 13, 2015 (edited) We have the same issue with our shop, the problem is that the path to the modules is relative. For example I use the varriable {$module_dir}img/image.jpg in the mymodule.tpl. This creates a path like /modules/mymodule/img/image.jpg Instead of www.example.com/modules/mymodule/img/image.jpg This is part of the reason why the images are still loaded from the main domain (www.example.com) and not from the CDN. Maybe this can be fixed with a .htaccess tweak, I'm not an expert in this area so until now I did not find a solution. An example; The native prestashop module "Product payment logos block v1.3.6 - by PrestaShop" does this. the path to the image with a media server enabled is as follows; <img src="/modules/productpaymentlogos/img/2e8686d04cc00384b3493846631bac8b.png" alt="" class="img-responsive"> Edited March 13, 2015 by thejustme (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts