Some of our questions and answers

This is a short list of some questions and answers. Type one or more keywords above to find what your are looking for.

Billing

I'm a freelance in France so as a very small business I don't pay the VAT (Article 293 B of french tax law). If you check the price you will see that there is no VAT or tax included in it. That's why I don't have any tax ID or VAT number.

Page Cache Ultimate JPresta Speed Pack

These fake users are created by Page Cache Ultimate to anonymize the cache (new method). You must not delete them (they will be created again).

There will not have a lot of these fake users, probably less than 5, it depends on the number of groups and the differences in display between them.

They are not active so they will not disturb your statistics.

Page Cache Ultimate JPresta Speed Pack

If you have an Anvato theme, here is what to do to avoid the cart to open each time it is refreshed.

Copy the file /modules/an_theme/views/js/sidebarcart.js in your theme so you can continue to update it without loosing modifications, in /themes/<your_theme>/modules/an_theme/views/js (create folders if needed)

In this file, replace the ligne:

if (prestashop.page.page_name != 'cart' && prestashop.page.page_name != 'checkout') {

By

if (prestashop.page.page_name != 'cart' && prestashop.page.page_name != 'checkout' && requestData.action!='refresh') {

Then clear the cache in Performances page and the cache of your browser so you can test.

Page Cache Ultimate JPresta Speed Pack

If your theme uses the tag "widgetblock" as Warehouse theme does, then you need to clear the cache in Performances page after you enable Page Cache so the template is compiled again.

Page Cache Ultimate

All our modules can run on LiteSpeed Web Server since it supports the Apache .htaccess file.

However, the HTML cache feature (Page Cache Ultimate) is not compatible with the LiteSpeed Cache Plugin since they are both working on the same layer of cache.

Which one should you choose?

LiteSpeed Cache is a generic cache which does not handle all different contexts of Prestashop. Which taxes are applied? Is there a flash sale comming up? Should I display a different content for this user because he belongs to a specific user group? Did this visitor accept cookies? etc.

Page Cache Ultimate has been created for Prestashop and it is only dedicated to this platform, it handles all different contexts and can also upgrade fast if a new Prestashop feature is out.

WebP JPresta Speed Pack

If you are using Nginx, then make sure your configuration is as follow:

Nginx configuration for Speed Pack module

"Proxy mode" must be ON, other options must be OFF.

Page Cache Ultimate JPresta Speed Pack

If you are using the PageSpeed Apache module developped by Google (x-mod-pagespeed) then you must disable the following option so it does not override the browser cache directives added by Page Cache:

<IfModule pagespeed_module>
ModPagespeedModifyCachingHeaders off
</IfModule>
Billing JPresta Cache Warmer

You can find your invoice in your JPresta account in the "Order history and details" menu.

If you don't see it make sure you registered an address in your account so the invoice can be generated.

Page Cache Ultimate JPresta Speed Pack

No, it is highly recommended to keep the Smarty cache enabled. This will speed up pages that are not cached and also pages where the cache is not yet generated.

Page Cache Ultimate JPresta Speed Pack

To get your styles back you just need to clear the cache of "Page Cache Ultimate".

To avoid this issue you can go in "Advanced mode", in the configuration of "Page Cache Ultimate", then in "Cache key" enable "Insert CSS and JS version in cache key".

Page Cache Ultimate JPresta Speed Pack

To avoid the cookie notice to appear 1 second, then disappear, you must override the javascript file of the iqitcookielaw module.

To do it, create a file with the following content:

$(document).ready(function () {
 if (getCookie('cookielaw_module') != 1) {
  $("#iqitcookielaw").addClass('iqitcookielaw-showed');
 }
 $("#iqitcookielaw-accept").click(function (event) {
  event.preventDefault();
  $("#iqitcookielaw").removeClass('iqitcookielaw-showed');
  setcook();
 });
});

function setcook() {
 var name = 'cookielaw_module';
 var value = '1';
 var today = new Date();
 var expire = new Date();
 expire.setTime(today.getTime() + 3600000 * 24 * 14);
 document.cookie = name + "=" + escape(value) + ";path=/;" + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
}

function getCookie(cname) {
 var name = cname + "=";
 var ca = document.cookie.split(';');
 for (var i = 0; i != ca.length; i++) {
  var c = ca[i];
  while (c.charAt(0) == ' ') c = c.substring(1);
  if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
 }
 return "";
}

And place it in the theme (or child theme if you have one): /themes/warehouse/modules/iqitcookielaw/views/js/front.js

Then clear the cache in the Performances page.

Page Cache Ultimate JPresta Speed Pack

When the cache is created, the page is anonymized, that means it is displayed without any information about the visitor displaying the page.

Modules that display content relative to the current visitor can be marked as dynamic, that means the content will be refreshed (replaced) by a background request (Ajax) in the browser that will carry the context of the current visitor.

If you check the option "Display nothing in cache" then the module will not be called to display its content in this hook during the creation of the cache. However, the content will be displayed as other dynamic modules (with a background request (Ajax)).

Page Cache Ultimate JPresta Speed Pack

If the products list is reloaded each time you display a page with a products list then you can fix this by modifying the file /warehouse/modules/ps_shoppingcart/ps_shoppingcart.js as follow:

How to fix warehouse theme

Replace this line:

prestashop.emit('updateFacets', window.location.href);

By:

if (event.reason && event.reason.linkAction != 'refresh') {
    prestashop.emit('updateFacets', window.location.href);
}
Page Cache Ultimate JPresta Speed Pack

Upgrade to Page Cache Ultimate 7.9.39 at least for a full compatibility with cookiesplus module.

WebP

If after the installation of the module some images of your store are not displayed anymore like the logo, the images of the CMS pages, the images in the backoffice, etc. it is because of the .htaccess file of the /img directory. This one blocks any PHP script, even if it is a redirection (the script is not really in this directory).

To correct this problem you have to rename the file /img/.htaccess to /img/.htaccess.off

Modifications done in a module, in the theme, in CSS or in Javascript cannot be automatically detected so you need to clear the cache to see the changes.

There are 3 ways to clear the cache

  1. In the configuration of the module "Page Cache Ultimate", go in "Statistics" menu. You can filter pages that are concerned by your modifications. Then click on the button "Clear cache" at the bottom of the table.
  2. Click on the button "Clear cache" in the configuration of the module "Page Cache Ultimate" on top and right of the screen, this will clear the cache all pages.
  3. Use the URL that you will find in the "API" menu in the configuration of the module "Page Cache Ultimate"
Page Cache Ultimate JPresta Speed Pack

In the configuration of the shopping cart, in section "Add to Cart Action", disable the option "Open the cart".

Creative Element - shopping cart options

JPresta Origin

If you are using the module "SuperTinyMCE PRO" developed by Liewebs then you must add an exception in the configuration of this module for the controller "JprestaThemeConfiguratorLive". Also make sure to have at least version 1.2.2 of module "JPresta - Theme Configurator".

WebP JPresta Speed Pack

Yes, all images of your shop will be automatically converted into the WEBP format. Even images from CMS or other modules like blog.

Page Cache Ultimate JPresta Speed Pack

This is normal, when the cache is not available the display is as slow as without the cache.

You should only empty the cache when necessary (CSS or Javascript modification, for templates choose the option "Recompile template files if they have been updated" in the "Performance" page).

WebP JPresta Speed Pack

YES you still need a WEBP module for Prestashop! Because the feature has a bug in PS 8.0. It should be fixed in PS 8.1 but I will check this as soon as it is released because I don't know if JPG images will be displayed to browsers that cannot read WEBP format like Safari (iPhone).

WebP JPresta Speed Pack

This has been very tricky to find a configuration that works fine. I'm not expert in the configuration of nginx so I guess there is an other way of doing it. If you want to improve this configuration then contact me, I will be happy to update this post to help other people!

Here is my solution (be kind).

Before the section "server", place this code:

map $http_accept $webp_enable {
	default 0;
	"~*webp" 1;
}

It will tell us if the browser of the visitor can read WEBP images.

You probably have multiple lines of "rewrite" for all images, place the following code just before it:

# Jpresta Speedpack
if ($webp_enable = 1) {
	# Rewrite images URL using a specific extension ".webp_compressor" so we can have specific rules to compress the image/svg
	# if the webp file is not already created.
	rewrite "^/c/([0-9]+)(\-[_a-zA-Z0-9-]*)/(.*)\.jpg$" /img/c/$1$2.webp_compressor last;
	rewrite "^/c/([_a-zA-Z-]+)/(.*)\.jpg$" /img/c/$1.webp_compressor last;
	rewrite "^/([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$1$2.webp_compressor last;
	rewrite "^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$1$2$3.webp_compressor last;
	rewrite "^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$3/$1$2$3$4.webp_compressor last;
	rewrite "^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$3/$4/$1$2$3$4$5.webp_compressor last;
	rewrite "^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.webp_compressor last;
	rewrite "^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.webp_compressor last;
	rewrite "^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.webp_compressor last;
	rewrite "^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.webp_compressor last;  
	# all other images
	rewrite "^(.+)\.jpg$" $1.webp_compressor last;   
}

location ~* ^(.+)\.webp_compressor$ {
	# Indicates to proxies that the file content/format depends (Vary) on the "Accept" header
	add_header Vary Accept;

	# Indicates to proxies that the file can be cached for the max duration
	add_header Pragma public;
	add_header Cache-Control "public, must-revalidate, proxy-revalidate";
	expires max;

	# Indicates to nginx not to log access
	access_log off;
	log_not_found off;

	# Try to serve the WEBP file directly or compress the image
	set $url_webp_compressor "/modules/jprestaspeedpack/controllers/front/webp.php?src=$1.jpg";
	try_files $1.webp $url_webp_compressor;
}

Contact me if you need help or if you can improve the script!

Page Cache Ultimate JPresta Speed Pack

If the currency selection list does not work anymore, check these 2 options:

The option "Ignore URLs matching this regex" must include ".*SubmitCurrency=1.*", e.g. ".*[\?&]q=.*|.*SubmitCurrency=1.*"

The option "Ignored URL parameters" should not include "submitcurrency,id_currency"

You may also want to disable the browser cache, because if the visitor changes the currency after displaying several pages, if they return to these pages, the original currency will be displayed.

Don't forget to clear the module and browser cache after these changes.

JPresta Cache Warmer
Unable to get cache-warmer informations from the shop (maybe the module is disabled or uninstalled): Read timed out

If you see this error in the log of the cache-wamer, that means there is a timeout when the cache-warmer retrieves the pages to warm up. To avoid this timeout, in the configuration of Page Cache Ultimate, click on "Advanced mode", then in the menu on "Options" and set a lower value for "Max execution time in seconds".

WebP JPresta Speed Pack

​Yes, browsers that cannot read WEBP format will get the original format (JPG/PNG).

This is the desktop view, to see the adapted view you must reload the page!