Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
The setting for: uc_ajax_cart are attached.
Up until now when adding products to the ajax cart, they were added for both guests and registered users. now only registered users can add. I checked my permissions and everything and could not figure out the problem.
Did I miss something?
Thanks,
Vanessa
Comment | File | Size | Author |
---|---|---|---|
#4 | ScreenHunter_03 Jul. 26 14.08.jpg | 35.25 KB | VanessaM |
ScreenHunter_01 Jul. 25 15.22.jpg | 72.21 KB | VanessaM |
Comments
Comment #1
tunicI can't reproduce the bug with your posted settings, but you missed the last lines, 'Ajaxified products'. It should be 'Ajaxify all Ubercart products'. Do you have that setting this way?
And... whehn you say that "now only registered users can add" what it means? Do you see an error message when an unregistered user try to ad? They just can't see add to cart buttons? You push the button and nothing happens?
Also, are you using a custom theme? if yes, please try with Garland theme to check if a theme-related problem.
As I can't reproduce I change it to support request.
Comment #2
VanessaM CreditAttribution: VanessaM commented- The 'Ajaxify all Ubercart products' option is checked
- The 'add to cart' button does appear but when clicking it, a message appears noting that the product has been added but nothing displays in the shopping cart. There are no error messages. Only when I log in as an authenticated user and click the button, the products do get added immediately.
I switched to the Garland theme and there was no change in behavior.
I suspected that the problem was cache as products I added yesterday suddenly appeared this morning. After changing some of the Boost settings I got it working again.
This can be closed.
Thanks!
Comment #3
tunicCan you post your Boost settigns that makes Uc Ajax Cart to work with Boost? So other people can have these modules work together... or did you just remove these paths from boost caching?
Comment #4
VanessaM CreditAttribution: VanessaM commentedAttached.
I set the: "Boost - Static page cache:" to disabled
Comment #5
tunicThanks for te info.
Comment #6
com_net CreditAttribution: com_net commented"I set the: "Boost - Static page cache:" to disabled" -- this means that You completely switched off the Boost module.
Anyone else managed to get to work Boost+Ajax Cart?
---
I see very strange bug: when guest adds something to his cart - ajax cart refreshes, shows correct content... and then refreshes another time - with returning to old cart content. On /cart page - everything is ok, new cart content represented.
Example: http://www.legrand1.budka.ru/
Comment #7
Erik Seifert CreditAttribution: Erik Seifert commentedGood old Browser cache ;- (
Please try this on.
Go to uc_ajax_cart.module.
Add this line in Line 112
Please give feedback if this works. Thanx.
Comment #8
com_net CreditAttribution: com_net commentedAll my tests were carried out with disabled caching on the client side. Nevertheless, I followed your advice: as expected - nothing has changed. For a split second after the page load you can see correct cart contents, and then it replaces with the wrong, which statically cached on server. You can see this effect following the link http://www.legrand1.budka.ru/catalog/legrand-valena
Comment #9
Erik Seifert CreditAttribution: Erik Seifert commentedHmpfff,
@tunic
How about making adding a parameter to our cart urls.
Like
Comment #10
Erik Seifert CreditAttribution: Erik Seifert commentedNow you got a js error
Comment #11
tunicI thought that removing UC Ajax Cart paths from boost caching was enought:
I'm not used to Boost, but I UC Ajax Cart paths are excluded Boost shouldn't handle these request, so right data should be retrieved ok by Ajax calls. May be we have two issues at same time?
@erikseifert It would be easy to add that parameter, for example, take ajaxCartUpdateBlockCart function in uc_ajax_cart.js and substitute this line:
By this:
(Just add Math.floor(Math.random()*1000000001) to the call).
I guess that parameter should be added to every path called by UC Ajax Cart, but I'm not confortable with that solution. I think there's is something more we can do.
It may be related to this bug?
#679422: hook_exit() causes Ubercart "Add to Cart" to fail
Comment #12
ehudash CreditAttribution: ehudash commentedI have the same issue.
Using Boost and Ajax Cart 6.x-2.0-rc3.
Boost - Static page cache: ENABLED
Statically cache specific pages except:
Comment #13
Erik Seifert CreditAttribution: Erik Seifert commentedplease add this url's to boost:
Comment #14
armyofda12mnkeys CreditAttribution: armyofda12mnkeys commenteduc_ajax_cart
uc_ajax_cart/*
for BOOST exclude settings seemed to work for me
Comment #15
tunicOk, so finally:
- set 'Statically cache specific pages' Boost option to 'Cache every page except the listed pages' and set pages to:
Comment #16
VanessaM CreditAttribution: VanessaM commentedexcellent! thanks a lot. It is working fine for me now.
Comment #18
MakeOnlineShop CreditAttribution: MakeOnlineShop commentedI have the same problem of products not added to card even when I'm not using boost, any idea ?
Thanks for help.
Comment #19
halloffame CreditAttribution: halloffame commented+1 #18.. Having the same problem but not using Boost Module
@make-online-shop How did you go about doing this?
Comment #20
MakeOnlineShop CreditAttribution: MakeOnlineShop commentedI'm not using it anymore... not worth the pain, customers are good enough to click on cart to see the cart page !
Comment #21
globaltask CreditAttribution: globaltask commentedIn case someone is till facing the issue and it's not fixed by changing Boost values or disabling it, the reason could be the anonymous user is missing in the users table.
In order Ubercart to work for anonymous users, the users table should have a user with ID: 0 and name: Anonymous.
Hope it helps!
Comment #22
adams780 CreditAttribution: adams780 as a volunteer and commentedI have the same issue, and don't use the Boost module. When you say the reason could be that anonymous user is missing in the users table, do you mean the users table in my site's drupal SQL database? I just checked the database, an sure enough there is not a user with the name Anonymous and/or an ID of 0.
Can/should I add that user through the drupal interface (if so, how)? Or do I have to add that user directly through the database (through phpMyAdmin)?
Comment #23
drupalinthailand CreditAttribution: drupalinthailand commentedAnonymous do not have any name, the line is empty, they are not called anonymous, on drupal 6 at least.
You can create in in mysql:
https://www.drupal.org/node/1029506
I tried, it works.
Comment #24
More_well CreditAttribution: More_well commentedHere is my solution:
Go to DB and check if have a row in users ->
1. SELECT * FROM `users`
2. Check do you have user with id = 0 ( uid column ) ;
If doesn't have it
-> put this sql ->
and click Go