• Priority: 0
  • Status: Waiting on customer
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 23.01.23, 11:55
  • Opened by: Riccardo Rossi

Ticket #24197 - Language and Currency Issue when the cache is on.

I have some problems with my Prestashop site. I installed Prestashop 1.7 + Alysum theme and when I activate the cache the language and currency dropdown menus get messed up. They link to random product pages.
Other than that I don’t know how to edit the AMP page if I have the Elementor page builder active.

Comments

Riccardo Rossi 23 Jan 2023, 17:27

I’ve been waiting all day could someone answer me please?

Fred 23 Jan 2023, 17:30

Hi, Riccardo.
Please fill out all necessary fields in your profile https://support.promokit.eu/myprofile to access to your Back-office and FTP Server

Fred 23 Jan 2023, 17:31

Sorry, but we have other customers too.
Our response time is up to 48 hours, but of course we are trying to do that as soon as possible

Riccardo Rossi 23 Jan 2023, 17:36

How do I change the AMP homepage if I use Elementor for the Desktop version of the site? The AMP Homepage page doesn’t work.I followed this video(https://www.youtube.com/watch?v=V3uNf7ytaEc&t=10s) but there is no AMP homepage

Fred 23 Jan 2023, 17:37

Please fill out all necessary fields in your profile https://support.promokit.eu/myprofile to access to your Back-office

Riccardo Rossi 23 Jan 2023, 17:48

May I ask you to tell me what to check? My client doesn’t want to share logins, there is private content on his website. Thanks

Fred 23 Jan 2023, 17:55

I need to see what exactly wrong there in other case it’s hard to help.
Try to import AMP layout, see attachment, I hope that will help

Attachments:

amp.txt (43.5 KiB)
Riccardo Rossi 23 Jan 2023, 18:44

Here is the procedure. I go to the AMP settings I go to the homepage tab I click on edit homepage and there is no page. I installed the latest version of Alysum with its modules, but maybe installing Elementor doesn’t install the page builder that was there before. Could it be due to this?

Attachments:

Fred 23 Jan 2023, 18:59

It’s hard to work in in this way.
Please provide access to modules in your back office to let me see what’s going on
We are working here since 2011 and no one had any problems providing back-office access

Riccardo Rossi 24 Jan 2023, 11:12

Morning Fred! I’ve just set up a Prestashop demo for your test. I’ve installed Alyssum but the shop has an error when Asylum is active, and It is not displayed properly. I left you the logins so we can see on this demo what are the problems to solve. It’s on the same server as the main site, with the same settings.

Fred 24 Jan 2023, 18:22

Please tell me what prestashop version do you use?
We just found out a problem with version 8.0.1

Riccardo Rossi 24 Jan 2023, 18:27

1.7.8.8 Have you try to check what’s wrong with the installation I gave you access to?

Fred 24 Jan 2023, 18:39

Yes, we found out the error caused by Widgets module. I need access to module folder on your server to try to fix it

Riccardo Rossi 24 Jan 2023, 19:35

SFTP access added

Fred 24 Jan 2023, 19:56

The issue has been fixed.
Something wrong was with the menu dropdown template

Riccardo Rossi 24 Jan 2023, 20:24

SFTP access added

Fred 24 Jan 2023, 20:41

We currently working locally to figure out what exactly wrong and make a fix
Sorry for the inconvenience

Riccardo Rossi 25 Jan 2023, 09:07

Great! Could you please tell me what was wrong? Anyway, that was the first thing. How can I create the AMP homepage?

Fred 25 Jan 2023, 18:29

for some reason in the last menu item was selected header layout.
Go to AMP settings → Home page and use builder to build a page

Riccardo Rossi 25 Jan 2023, 18:34

Go to AMP settings → Home page and use builder to build a page = SCREENSHOT

Attachments:

Fred 25 Jan 2023, 18:36

Try to reset AMP module

Riccardo Rossi 25 Jan 2023, 18:52

Nice! Now it works! Thanks. Now the real problem: When I activate Smarty cache of Prestashop, the language top menu works strangely. If I visit a page and change the language, it sends me to the previous page in the selected language. Try doing a test to see what I mean.

Fred 25 Jan 2023, 19:27

that was cache issue. now it should be fixed

Riccardo Rossi 25 Jan 2023, 19:37

Great! Would you please tell me what have you done so I can do it in the live version of the website?

Fred 25 Jan 2023, 19:50

updated file is
/public_html/modules/pkelements/classes/WidgetPklanguages.php

Riccardo Rossi 25 Jan 2023, 20:00

Ok Thanks. Do you know how can I translate my Account, My Cart, and My Favourite menu items in the menu?

Fred 25 Jan 2023, 20:04

use our translation catalog to find where translation is https://alysum.promokit.eu/promokit/documentation/translations/

Riccardo Rossi 25 Jan 2023, 20:16

Is there some way using the theme settings to hide the sign in button when a user is logged in?

Fred 25 Jan 2023, 21:14

unfortunately there is no such option

Riccardo Rossi 26 Jan 2023, 10:11

I saw how you solved the language and cache problem. I noticed a similar thing happens for currencies as well. In practice, the currency does not change and the user’s default one remains saved in the cache. I would like caching to be turned on for the whole website, not selectively disabled for the ones that aren’t working properly.

Fred 26 Jan 2023, 19:33

the issue should be fixed now, please check

Riccardo Rossi 26 Jan 2023, 20:47

OK I saw that you “fixed” the cache on modules\pkelements\classes\WidgetPkcurrencies.php in the same way you “fixed” WidgetPklanguages.php

It seems that the problem is all over the homepage, and it is directly related to the widgets and blocks used by the “elementor” page builder.

NEW FOUND BUG:
in the homepage, with the smarty cache ON, the currency on the modules “featured, special, new” etc DOES NOT change when a different currency is selected in the above WidgetPkcurrencies widget.

STEPS:
1- smarty cache is ON
2- cache is cleared
3- e.g. USD ($) is selected → prices are correctly shown in US $
4- currency is changed e.g. to EUR (€)
5- prices are still shown in US ($)

bonus:
6- if I navigate to a category page, I can correctly see prices correctly switched to EUR (€)
7- but if I come back to the homepage, still USD ($) (the first cached currency)

I understand that manually disabling the cache for each Elementor block that doesn’t work could do the trick, but I truly hope this is a temporary fix and you’ll actually figure out why Elementor elements are not caching correctly.

Thank you

Riccardo Rossi 26 Jan 2023, 21:00

ANOTHER BUG (#2)
the sign-in widget on the top right doesn’t work as intended : even if a user is logged in, it still shows the option to log in or register

I don’t think this has something to do with the cache, because it doesn’t work even with smarty cache disabled.

Alessio 27 Jan 2023, 19:25

fortunatamente non siamo gli unici ad avere numerosi problemi di cache con questo tema!Ci sta facendo impazzire il menù, con la cache attivata il menù perde totalmente la formattazione css…senza cache bene ma il sito è lentissimo

Fred 27 Jan 2023, 20:38

@Alessio. You have another problem which is already fixed in the latest version. So please update.
@Ricardo. Please check out Sign in issue now

Fred 27 Jan 2023, 21:21

The issue with currency switching is also fixed

Riccardo Rossi 27 Jan 2023, 21:34

sign in still not working as intended
please see attached screenshot

currencies seem to be OK
I will later check what you did on WidgetPkproducts.php

thank you

Attachments:

Riccardo Rossi 27 Jan 2023, 21:54

you know, it will be nice that, when a customer is logged in, the “sign in” link turns into “my account” or something like that ¯\_(ツ)_/¯

Fred 27 Jan 2023, 22:03

wait, but that’s not an bug at all. That widget display login form independently from the state of visitor.
As for your suggestion, that’s good idea, but we can only add it to our TODO to implement in further updates

Riccardo Rossi 27 Jan 2023, 22:06

looks kind of a bug to me

it shouldn’t be possible to log in again, or even worse, try to register if you are already logged in

the customer will be confused to see this option when not necessary

it is just standard behavior of any e-commerce website

try to think of something like that happening on Amazon or eBay…….

Riccardo Rossi 27 Jan 2023, 22:07

on another note, isn’t there another way to fix those issues without selectively disabling the cache?

Riccardo Rossi 27 Jan 2023, 22:09

can you please confirm you modified only these two files:
./modules/pkelements/classes/WidgetPksignin.php
./modules/pkelements/src/WidgetCache.php


I see the timestamp of ./modules/pkelements/classes/WidgetPkproducts.php is different
but can’t find any changes from the original


thank you very much for your support!

Fred 27 Jan 2023, 22:13

the major update is in WidgetCache.php, the rest files can be ignored.
We will continue to work on a solution for the new issue tomorrow, today is too late
You are welcome!

Riccardo Rossi 28 Jan 2023, 00:31

bad news, that mod you made to WidgetCache.php throws a fatal error when trying to modify the homepage using the page builder (creative elements → content anywhere → edit home)
screenshot attached

this on the production server, which has a bit more content than the demo site you are working on
for the time being i’ll comment out that line when editing the home, but still…….

Attachments:

Fred 28 Jan 2023, 12:33

Strange that prestashop throws an error for its own function. It should be fixed now

Fred 28 Jan 2023, 12:59

Sign In link is replaced with Sigh Out if customer is logged in

Riccardo Rossi 02 Feb 2023, 11:39

Hello, again Fred. I found a couple more things to fix: From mobile, the dropdown menu of languages and currencies doesn’t work.
Also by scanning with Google Insight I found that the theme uses jQuery 1.10.3. Don’t you think it’s a bit old version? Can I add a newer version or will the website break?

Attachments:

Fred 02 Feb 2023, 17:15

I don’t see the languages on your website https://take.ms/9Uv1W

As for the jQuery, that’s default version for Prestashop. The theme itself doesn’t bring any jQuery library to your website.