Jump to content

Not working shopping cart after Upgrade 1.7.8.0


MuniGod

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

Link to comment
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..

Link to comment
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. 

 

Link to comment
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
Link to comment
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

Link to comment
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
Link to comment
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!

Link to comment
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?

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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
Link to comment
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

Link to comment
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 ?

Link to comment
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.

Link to comment
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.

Link to comment
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?

Link to comment
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)
Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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

Link to comment
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 2
Link to comment
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? 

Link to comment
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

 

 

  • Thanks 1
Link to comment
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}

Link to comment
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.

Link to comment
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 3
  • Thanks 2
Link to comment
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

Link to comment
Share on other sites

I finally solved all problems. Now 1.7.8.6. works excellent. No need for core.js or other setting outside normal upgrade. From 1.7.7.4 do 1.7.8.6 What I do?

Step 1.: deactivate all modules not made by presta (only default modules are active) prestashop 1.7.7.4

Step 2.: download all updates from 1.7.7.4 to 1.7.8.6 to pc

Step 3.: unpack all zip files in separate folders as update (eg zip of 1.7.7.6 to folder presta 1.7.7.6, etc)

Step 4.: in BO I go to 1-one click upgrade, put my shop in maintenance mode. In this module section "Start your upgrade" go to "expert mode" and choose Channel "Local directory" and in "Please tell us which version you are upgrading to (1.7.0.1 for instance)" wrote first next ugrade above 1.7.7.4.

Step 5.: with Freezilla (or other upload software) I upload folders in his origin unzipped folder to folder /admin/autoupgrade/latest/ . (In my folder presta 1.7.7.6 I copy zip file for this upgrade and than unzipped)

Step 6.: start ugrade.

Step 7.: I refresh the page, log out and login to my presta. And deleted all folders inside  /admin/autoupgrade/latest/ 

Step 8.: repeat steps from Step 4. to step 7. with another ugrade version 1.7.7.7. and so one.

 Step 9.: After I finish upgrading final 1.7.8.6 I start activate modules I was deactivated in Step 1, activate one by one and check if it is work. Some modules not worked and deinstall them.

Step 10.: Check translate on my language, made some translating, try to "place an order" as buyer and all works excellent.

So I upgrade one after another till rich 1.7.7.6---1.7.8.2---1.7.8.4---1.7.8.6

After all that, indexed and clear cache.

Hope this will helpfull for all.

Edited by IvicaB (see edit history)
  • Like 1
Link to comment
Share on other sites

12 hours ago, Maurice said:

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

Well I made a test for one of my customers, after replacing the core.js file and solving the issue, I brought back the original core.js file and it’s working now!

Please test and see if it’s working for you as well.

 

11 hours ago, IvicaB said:

I finally solved all problems. Now 1.7.8.6. works excellent. No need for core.js or other setting outside normal upgrade. From 1.7.7.4 do 1.7.8.6 What I do?

Step 1.: deactivate all modules not made by presta (only default modules are active) prestashop 1.7.7.4

Step 2.: download all updates from 1.7.7.4 to 1.7.8.6 to pc

Step 3.: unpack all zip files in separate folders as update (eg zip of 1.7.7.6 to folder presta 1.7.7.6, etc)

Step 4.: in BO I go to 1-one click upgrade, put my shop in maintenance mode. In this module section "Start your upgrade" go to "expert mode" and choose Channel "Local directory" and in "Please tell us which version you are upgrading to (1.7.0.1 for instance)" wrote first next ugrade above 1.7.7.4.

Step 5.: with Freezilla (or other upload software) I upload folders in his origin unzipped folder to folder /admin/autoupgrade/latest/ . (In my folder presta 1.7.7.6 I copy zip file for this upgrade and than unzipped)

Step 6.: start ugrade.

Step 7.: I refresh the page, log out and login to my presta. And deleted all folders inside  /admin/autoupgrade/latest/ 

Step 8.: repeat steps from Step 4. to step 7. with another ugrade version 1.7.7.7. and so one.

 Step 9.: After I finish upgrading final 1.7.8.6 I start activate modules I was deactivated in Step 1, activate one by one and check if it is work. Some modules not worked and deinstall them.

Step 10.: Check translate on my language, made some translating, try to "place an order" as buyer and all works excellent.

So I upgrade one after another till rich 1.7.7.6---1.7.8.2---1.7.8.4---1.7.8.6

After all that, indexed and clear cache.

Hope this will helpfull for all.

Thanks for sharing your solution, but it seems hard for non-pro users and they may make new issues on their shops if they make any mistake in this process. I hope the PrestaShop team will take care of this issue on next updates.

  • Like 1
Link to comment
Share on other sites

On 6/15/2022 at 7:23 PM, Mehrshad Zakerian said:

Well today I received some reports from clients which were using PS1.7.8.x that when they click on Add To Cart button it needs a manual refresh to update the quantity inside Cart module. Also there was the same issue for deleting a product from cart. It seems that there are some changes on "core.js" file which prevent themes developed by other developers (not default theme) to auto refresh cart changes.

I searched for the solution which I found this topic and one from Stack Overflow. Here is the solution which worked for me finally:

(Please make sure you have backed up everything before any changes)

  1. I replaced the core.js file from PS1.7.7.8 with my current file inside themes folder (thanks to @dimtsef)
  2. I reseted the ps_shoppingcart module (thanks to AuRum for their answer at Stack Overflow)
  3. I cleared PS cache (you can do it manually by removing prod and dev folders inside var/cache directory)

And it is working fine now!

Works like a charm, what a legend!

This works on PS 1.7.8.7 with the core.js provided by @dimtsef (Path to change this file is /themes/core.js)

Remember to clean cache on boths sides

Edited by ChineseNorris (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

one more issue:

after upgrade from 1.7.6.5 to 1.7.8.7

on product page - when product has combinations - if I select not a default combination the main picture does not change to this combination and stays the default one.

Any ideas why?

 

Github link with this issue: https://github.com/PrestaShop/PrestaShop/issues/29466

Edited by Yulia Vitun
GitHub link updateed (see edit history)
Link to comment
Share on other sites

  • 4 weeks later...
On 6/15/2022 at 7:23 PM, Mehrshad Zakerian said:
  • I replaced the core.js file from PS1.7.7.8 with my current file inside themes folder (thanks to @dimtsef)
  • I reseted the ps_shoppingcart module (thanks to AuRum for their answer at Stack Overflow)
  • I cleared PS cache (you can do it manually by removing prod and dev folders inside var/cache directory)

Hi,

thanks for the tips. I am having the same problem upgrading from Prestashop 1.7.7.3 to 1.7.8.7 version.

I tried replacing the file with the core.js provided here and clearing the cache. Actually after that the cart works, but it seemed to work badly, because it was much slower to update than on the original site.

I tried to reset the ps_shoppingcart module, but this makes the cart completely disappear from the site, and if I try to add a product to the cart nothing happens. And consequently any addition of products to the orders is impossible. The cart page, on the other hand, can be reached, but only using the specific link. Updates of the quantities of products already present in the carts can be made, but they are always as slow as before.

I have done these operations on a "demo copy" of my site, then an http site, if that could affect it.

Link to comment
Share on other sites

Replace core.js in Themes with a backup version from February 2021 and the shopping cart, languages and currency dropdown menu, product details and product images click to zoom feature were immediately fixed. Clear cache and PHP 7.4 selection were also applied. 

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
On 11/8/2022 at 2:51 PM, kratek said:

Quick fix:

Add code below to your custom.js file in your theme:

if(typeof(prestashop) != 'undefined') {
    $(function() {
        let i;
        let e = {}
        e.resp = '';
        prestashop.emit('updateCart', {reason:i,resp:e});
    });
}

 

This is not working on my shop smartwall.dk. This bug is driving me crazy:-(

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...