Jump to content

Not working shopping cart after Upgrade 1.7.8.0


MuniGod
 Share

Recommended Posts

After upgrade not working shopping cart.

First when upgrade to 1.7.8 and PHP 7.3 at shopping cart not working ajax update on products quantities and delete not working.

When change to PHP 7.4 error in shopping cart: Notice: Trying to access array offset on value of type null

First issue I think with jquery. Second need check if is set index.

But I don't know where fix it.

Or it is theme problem or core?

Any ideas?

 

Screenshot (137).png

Screenshot (138).png

Screenshot (139).png

Screenshot (140).png

Screenshot (136).png

Screenshot (141).png

Share this post


Link to post
Share on other sites

With theme classic everything work.

Some problems i fixed, but more and more problems.

My theme not ready for work with PHP 7.4, and after update from PS 1.7.7.8 to 1.7.8.0 something changes in JS so not working auto refresh in shopping cart.

So probably I will rollback to previous version.. :( 

I Will Try contact with theme creator, maybe soon will be theme update. iF no, then will use old PS..

Share this post


Link to post
Share on other sites

  • 2 weeks later...
Le 20/10/2021 à 1:28 PM, brka a dit :

Thanks.

Hi brka, I just took a look at your online store and noticed that your issue with updating the cart has been fixed.  Could you please tell me more about the procedure? I have the same problem, I have to refresh the page in order to delete a product from cart or to modify the quantity. 

 

Share this post


Link to post
Share on other sites

Yes, I solved the basket problem, but there were still a lot of problems after the update. I solved the problem by contacting a member of the forum and hiring him to solve all my problems. His nickname on the forum is @razaro. If you want you can contact him. Good luck

  • Thanks 2

Share this post


Link to post
Share on other sites

  • 2 weeks later...
On 10/22/2021 at 12:08 PM, brka said:

Yes, I solved the basket problem, but there were still a lot of problems after the update. I solved the problem by contacting a member of the forum and hiring him to solve all my problems. His nickname on the forum is @razaro. If you want you can contact him. Good luck

Would be very usesul if he share's the fix so we can get out of this issue... I've also faced same issue and going back to classic theme solves the error but not with child theme created from 1.7.7... Can you ask him if he chan share the fix here?

 

Thanks

Share this post


Link to post
Share on other sites

@ChineseNorris

I saw few things after upgrades to latest 1.7.8.0 and here are some fixes. Note sure if it applies to you it depends on different thigs.

- changing core.js in theme folder with one from original download

- depending on theme this can help if button in checkout is disabled https://github.com/PrestaShop/PrestaShop/pull/18904#issuecomment-944348444

- search module have CSS style overflow: scroll; and it should be overflow: hidden;  If you see scroll bars around search block.

 

Again your and @Norca and original poster  @MuniGod could have different issues. Also would be useful to add more details of errors.

Like if you enable debug mode does any error shows. Some hint in console when you inspect element on page of log from hosting or var/log folder.

  • Like 4

Share this post


Link to post
Share on other sites

On 11/1/2021 at 8:03 PM, razaro said:

@ChineseNorris

I saw few things after upgrades to latest 1.7.8.0 and here are some fixes. Note sure if it applies to you it depends on different thigs.

- changing core.js in theme folder with one from original download

- depending on theme this can help if button in checkout is disabled https://github.com/PrestaShop/PrestaShop/pull/18904#issuecomment-944348444

- search module have CSS style overflow: scroll; and it should be overflow: hidden;  If you see scroll bars around search block.

 

Again your and @Norca and original poster  @MuniGod could have different issues. Also would be useful to add more details of errors.

Like if you enable debug mode does any error shows. Some hint in console when you inspect element on page of log from hosting or var/log folder.

Thank you, seems that changing back to previous core.js works!

Share this post


Link to post
Share on other sites

My Autorefresh of shoping cart not work. I must refresh manually.  I have PHP 7.4, classic prestashop theme, I copy root/js and theme from installation zip file of 1.7.8.0 prestashop version, but still the same problem. Any help?

Share this post


Link to post
Share on other sites

All module are updated, all non native prestashop modules was disabled, but problems are lots and huge and exist. Classic prestashop theme, php 7.4. And after 11 days of struggling and asking for help and I do everything what was nice members suggest, my only options was do downgrade to previous version. Now with previous version 1.7.7.4 works excellent. What to do I don't know.

Share this post


Link to post
Share on other sites

I had the same problem after the update I was not able to solve it myself so I hired @razaro this member who fixed all my bugs. Everything could be fixed if you know, if you do not have the knowledge, seek help from the developer.

Share this post


Link to post
Share on other sites

  • 2 weeks later...

I had the same problem, that the cart did not add any products.

Then i looked in the log and discovered that the GEOLOCATION did some entries.
So I switched off the Geotargeting (International > Localization > Tab Geolocation)
And now the shoppingcart works fine.

Share this post


Link to post
Share on other sites

  • 3 weeks later...

The Cart module of my shop worked fine with version 1.7.6 of PrestaShop.  When I upgraded to version 1.7.8 I noticed the problems with the Cart module (the Refresh problem).  The problem therefore came from my custom Theme, with the PrestaShop default Theme everything was working normally.  I regularly make backups of my entire store, so what I did was just replaced the core.js file from my custom Theme in version 1.7.8 with the core.js file from my backup  when the store was in version 1.7.6 and the problem is solved.  Another solution would be to buy the One Page Checkout module and with this module the problem is also solved.

Share this post


Link to post
Share on other sites

On 11/26/2021 at 1:25 PM, webgarage said:

I had the same problem, that the cart did not add any products.

Then i looked in the log and discovered that the GEOLOCATION did some entries.
So I switched off the Geotargeting (International > Localization > Tab Geolocation)
And now the shoppingcart works fine.

Thank you, it worked with this solution.
Commented to thank you and to tell every one else know that it works.

  • Like 1

Share this post


Link to post
Share on other sites

  • 2 weeks later...
On 12/23/2021 at 9:00 AM, Lazsa said:

Same problem with 1.7.8.2

core.js owerwrite, and cache clear solved the problem :)

i try the same but the same... add to cart from hompage or category dont work only after refresh.

If have someone a good solution, share with us.

Thanks

Share this post


Link to post
Share on other sites

6 minutes ago, Nickz said:

In your root folder there should be a folder named cache, in it there could be several other folders, like smarty etc.

What PS Version you are on?

1.7.8, i clear in Var folder the cache, not in Cache folder, sorry, so what folder in cache folder i need to clean ?

Share this post


Link to post
Share on other sites

Just now, markoo said:

1.7.8, i clear in Var folder the cache, not in Cache folder, sorry, so what folder in cache folder i need to clean ?

P.S. 

this folders contain only index.php nothing else, i checked itt now

Share this post


Link to post
Share on other sites

27 minutes ago, markoo said:

1.7.8, i clear in Var folder the cache, not in Cache folder, sorry, so what folder in cache folder i need to clean ?

Usually all folders in cache can be emptied only leaving the index.php.

If you are on a shared server it could be that the server has an extra cache where you have no influence. Those are flushed every few hours.

Share this post


Link to post
Share on other sites

@markoo I try all this things before about one month. But nothing work. Install, reinstall, clear cash, change php, disable all non native prestashop modules, etc. I decide to back to my older version 1.7.7.4 with full restore and everything works excellent. I see there is still unsolved big problems (no autorefresh cart, no visible block in products page, cant made an order). The solution as I find is to pay about hundred euros to someone who can solve this problem. I don't have this money to pay for problem I did not made. So I am using my previous version and I am fine.

Share this post


Link to post
Share on other sites

15 hours ago, markoo said:

i try the same but the same... add to cart from hompage or category dont work only after refresh.

If have someone a good solution, share with us.

Thanks

/themes/core.js you overwrote it?

Share this post


Link to post
Share on other sites

On 11/8/2021 at 1:24 PM, SliderFlash said:

Hi! Thank you, I installed this module and Cart is worked but "exit from account issue" when I enter "address" not working. Finally I rollback to 1.7.7.6 and it work all things.

Good luck!

Edited: unfortunately one module that I purchased from a Prestashop coworker had problem.

Edited by honeyhub (see edit history)

Share this post


Link to post
Share on other sites

  • 2 weeks later...
2 hours ago, wzzly said:

Same problem here.... tried the core.js and ps_shoppingcart reinstall, but not working. Cart still not updating....

So I switched off the Geotargeting (International > Localization > Tab Geolocation)
And now the shoppingcart works fine.

Share this post


Link to post
Share on other sites

Just now, NunoACruz said:

So I switched off the Geotargeting (International > Localization > Tab Geolocation)
And now the shoppingcart works fine.

This option was already switched off. But I solved it. It had to do with friendly urls. When I turned it of, the cart was working OK. I then deleted my .htaccess (make backup) and enabled friendly urls again and now it works. Something must have messed up the htaccess when updating I guess... 

So for others with this problem. Try disabling friendly urls and see if it works then.

Share this post


Link to post
Share on other sites

  • 2 weeks later...
On 11/26/2021 at 8:25 AM, webgarage said:

I had the same problem, that the cart did not add any products.

Then i looked in the log and discovered that the GEOLOCATION did some entries.
So I switched off the Geotargeting (International > Localization > Tab Geolocation)
And now the shoppingcart works fine.

THANK YOU! After days and days of trying everything that worked for everyone else, THIS is what worked. Thank you for your comment.

Share this post


Link to post
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hello,

probably the problem is the theme.js in our (old) themes with the new core.js 1.7.8.x.

I have a mirror of my production website with PS updated from 1.7.7.8 to 1.7.8.3 and the cart does not update after deleting a product.

I was looking for the differences between the various files and I saw that the theme.js of the classic 1.7.7.x theme was the same as that of my theme.

So I thought of replacing this file in my theme with the one coming from the classic theme of 1.7.8.3 leaving unchanged the core.js 1.7.8.3

Once this is done, the cart is now updated after deleting a product.

At the moment I don't see any problems on the test site.

The technique is similar to downgrading 1.7.8.x core.js to 1.7.7.x but I think it's "cleaner".

Sorry for my English: D

Share this post


Link to post
Share on other sites

  • 3 weeks later...
  • 1 month later...

  

Hey all !

I am not a fan of downloading a minified JS file from a stranger and to put it on a live website (security first), so I tried to debug it on my own and succeeded.

I tried to add a new code.js from the last prestashop version, no change. So I jumped into the minified core.js and began to console.log.

After some time, I noticed in my console that I had a warning (not an error, a warning, and it was hidden at first...):

jQuery.Deferred exception: can't access property "cart", e.resp is undefined 999/<//themes/core.js

That was the key to solve the problem, I opened core.js, and searched for "e.resp". Lucky for me, there was only one "e.resp" in the file :)

After some console.log and testing, I changed :

o.default.cart=e.resp.cart

To

o.default.cart=e.reason.cart;

And that was it ! The e object had only "reason" as an argument. I don't know why, but deleting / updating an item now reload the prices :)

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

Just noticed another bug. On the product page the qty input always snaps back to 1 no matter what. Then in cart I can change qty no problem. I'm on php 7.4  and latest presta. Haven't checked the classic theme as our theme its a mess to switch back to (modules/positions etc) but copying parts of classic theme for form/input did not do the trick. So probably .js related.... Any idea where to start? 

Share this post


Link to post
Share on other sites

Thanks for your solution @CamilleV  :)

It has helped me come up with a solution that doesn't involve changing the new `core.js` file.

First I had a look at the git hub commits for the classic theme and I think the issue we are facing might have been introduced in the following commit

https://github.com/PrestaShop/PrestaShop/commit/aac9a5dff54b379fd5f546ec40aaad0a0d0b941e

I then looked into the uncompiled version of `_dev/js/cart.js` from my adapted classic theme  (which I also imagine everyone else's themes in this thread are derived from).

Make the following changes in `_dev/js/cart.js` (two instances)

prestashop.emit('updateCart', {
        reason: dataset
      });

to

prestashop.emit('updateCart', {
        reason: dataset,
        resp,
      });

then npm compile this back into your `assets/js/theme.js` should allow you to use the new 1.7.8.x `themes/core.js` without having to make your modification.

 

Lastly to note:

It seems they have done a bit of work on this file (cart.js) since 1.7.7.x so there might be other changes to watch out for as well. You can see the newest version here:

https://github.com/PrestaShop/classic-theme/blob/develop/_dev/js/cart.js (which doesn't even compile in npm for me 😕 )

Hope this helps

 

 

Share this post


Link to post
Share on other sites

for those who have this problem:

QTY input field on product page resets/snaps to 1 no matter how you input more than one, you need to delete this code in public_html/themes/YOURTHEME/templates/catalog/product.tpl:

{block name='product_refresh'}
      <input class="product-refresh ps-hidden-by-js" name="refresh" type="submit" value="{l s='Refresh' d='Shop.Theme.Actions'}">
{/block}

Share this post


Link to post
Share on other sites

  • 1 month later...
Le 14/04/2022 à 4:26 PM, CamilleV a dit :

  

Hey all !

I am not a fan of downloading a minified JS file from a stranger and to put it on a live website (security first), so I tried to debug it on my own and succeeded.

I tried to add a new code.js from the last prestashop version, no change. So I jumped into the minified core.js and began to console.log.

After some time, I noticed in my console that I had a warning (not an error, a warning, and it was hidden at first...):

jQuery.Deferred exception: can't access property "cart", e.resp is undefined 999/<//themes/core.js

That was the key to solve the problem, I opened core.js, and searched for "e.resp". Lucky for me, there was only one "e.resp" in the file :)

After some console.log and testing, I changed :

o.default.cart=e.resp.cart

To

o.default.cart=e.reason.cart;

And that was it ! The e object had only "reason" as an argument. I don't know why, but deleting / updating an item now reload the prices :)

Thank you very much Camille ;)  I really appreciate your method, finding out the real reason of the issue rather than overwriting a file without knowing the change. Of course thank you to people who posted the core.js patch, which at least help solving the issue.

Share this post


Link to post
Share on other sites

  • 3 weeks later...

Update - Jan 14, 2023

------------

Finally found the solution which works without needing any file replacement or any advanced steps (thanks to our friend response Nawres). Follow the steps below:

Before I continue to explain the steps, if you have changed your core.js file or you have replaced it with older versions (e.g. PS1.7.7.x, etc) remove it and upload the original core.js file which is within default PrestaShop file (exact the same with your PS version) then follow the rest of instructions.

Step 1: Open your core.js file which is inside your themes directory and edit it.

Step 2: Search for code below:

o.default.cart=e.resp.cart;

And replace it with:

o.default.cart=e.reason.cart;

Step 3: Reset your ps_shoppingcart module from your BO -> Modules.

Step 4: Go to your BO -> Advanced Parameters -> and click on Clear Cache button.

Step 5: Go to your store front-office, press Ctrl+Shift+R (or ⌘+shift+R on mac) to refresh your browser cookies.

You're done!

 

Edited by Mehrshad Zakerian
Updating the solution (see edit history)
  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites

  • 1 month later...

Dear Mehrshad Zakerian

i exactly followed Your Instructions , i replaced the core Js from Theme folder and i put the Core.js of prestashop 1.7.6.7 , reseted the shopping_cart Module , clear cache

and cart now work perfect. I just would confirm and Thanks to You

Now i m only afraid that the core.js of prestashop 1.7.6 can create problem with prestashop 1.7.8.6

Share this post


Link to post
Share on other sites