Product shouldn't be added to cart if customer didn't select a proper attribute
I think there could be something wrong with my ZC's settings because if I remembered correctly the attribute behaviour wasn't like this at my 1.3.8 store... though I can't confirm because that store no longer exists.
I have a product that is priced by attribute, like this:
Attribute 1: Please choose an option from below (this is "Used For Display Purposes Only")
Attribute 2: Chinese
Attribute 3: English
Attribute 4: Please choose an option from below (this is "Used For Display Purposes Only")
Attribute 5: 5 users
Attribute 6: 10 users (+ $100) (I have tested this and it doesn't matter if there is a price increase or not)
Both "Used For Display Purposes Only" attributes are marked selected by default, which (if I remembered correctly), at the previous 1.3.8 store, ensured that customer couldn't add a product to cart unless they have selected a language and a user number. However, I found that this is not the case with my new 1.5.1 store. If neither language or user attribute is selected, customer can't add the product to cart (correct behaviour); but if only one is selected (either language or user), the product can be added to cart. Since a big red warning will show up on the cart page when this happens (Please update your order. ... Invalid Option Values Selected), the customer will likely go back to the product page and make a selection again, which means there are now two same products in the shopping cart.
Is this simply a setting problem that I have overlooked in the admin or is there something wrong with my codes? I do have a payment gateway, a serial number module, and a dynamic price updater installed.
Thanks in advance!
Keywords: attribute error, display only attribute not working, duplicated product in cart, product added twice
Re: Product shouldn't be added to cart if customer didn't select a proper attribute
Do you have an URL to a Product where this is happening?
The default behavior is, if the Attributes are marked as:
Display Only YES
Default YES
then the Attributes cannot be the selected Attributes when adding to the cart or the error message is triggered ...
Re: Product shouldn't be added to cart if customer didn't select a proper attribute
Yup, here you go (a live shop):
2c (dot) hk/index.php?main_page=product_info&cPath=4&products_id=34&number_of_uploads=0&lang uage=en
The error message is indeed triggered but the product got added to cart anyway...
Thanks!
Re: Product shouldn't be added to cart if customer didn't select a proper attribute
I couldn't add to cart until I selected valid options for each ... :lookaroun
Re: Product shouldn't be added to cart if customer didn't select a proper attribute
Have you checked the cart page after seeing the warning on the product page? Because I just tested again on my phone and it was added to cart even though I didn't select how many users....
Re: Product shouldn't be added to cart if customer didn't select a proper attribute
I take that back ... it actually was adding it to the cart behind the scenes ...
Can you switch to Classic Template and see if that happens?
I have not seen something like that off the top of my head where it adds the products_id to the customers_basket but not the proper prid portion for the attributes, from what it appears to be doing ...
You are not doing any kind of Rewrites on your URL are you?
Re: Product shouldn't be added to cart if customer didn't select a proper attribute
Thanks, I'll do the template switch and test when there are less people on the website. Probably 10 hours later.
As for the URL rewrite, I think there is something like that set up at the server, I'll try to describe it:
The ZC store is installed in, say, user/public_html/dummydir but the shop URL is 2c dot hk instead of 2c dot hk/dummydir. This is something that I asked the host company to change for me.
Does that make sense? Sorry I'm not very familiar with server stuff...
Thanks!
Re: Product shouldn't be added to cart if customer didn't select a proper attribute
OK I saw that no actual users were on the website so I quickly switched to Classic and tested, and the behavior was the same: I was able to add product to cart.
Thanks!
Re: Product shouldn't be added to cart if customer didn't select a proper attribute
Check that the files on the server for:
/includes/templates/template_default/templates/tpl_product_info_display.php
/includes/templates/your_template_dir/templates/tpl_product_info_display.php
/includes/templates/template_default/templates/tpl_modules_attributes.php
/includes/templates/your_template_dir/templates/tpl_modules_attributes.php
/includes/main_cart_actions.php
/include/classes/shopping_cart.php
/includes/functions/functions_lookups.php
/includes/functions/functions_general.php
/includes/functions/functions_prices.php
/includes/functions/html_output.php
are current and up to date on your server for the version of Zen Cart that you are using ... as well as other files on your server ...
I do not understand why your shop would be stored in a subdirectory if it is run from the main directory ...
What do you see in your file, on the server, for the file:
/includes/configure.php
without your username and password information?
Re: Product shouldn't be added to cart if customer didn't select a proper attribute
Hi Linda,
Many thanks for your reply, I haven't got time to check the things you mentioned yet, but I discovered something just now when adding more Priced By Attributes products: if I disabled Dynamic Price Updater, the "background add to cart" problem does not occur. I've tried this on the latest Safari, Firefox and Chrome.
I was using version 3.0 of the plugin and I just found out that there is a newer version that came out last month but I haven't tried that yet.
http://www.zen-cart.com/downloads.php?do=file&id=1301
Will report back when I have more information.