-
AuthorPosts
-
February 10, 2021 at 1:11 am #1279277
I am requesting help with the ‘Add to Cart’ button.
Right now when an item is added to the cart and the item quantity is higher than what stock is available, the button looks like it is accepting the order but nothing actually gets added to the cart. I feel this is too confusing for the purchaser. Can the button function be set up to either:
!. only allow the item quantity to go up to the maximum inventory level; ie/ if there are 5 widgets in stock the ‘Add to Cart’ button will only go up to 5…..or
2. when the quantity added to the cart exceeds stock levels the item is rejected and an error message comes up stating the quantity exceeds stock levels.If there is a third option that you are suggesting I am open to this option as well. How have others handled this issue on the Enfold wp theme?
Thanks
February 12, 2021 at 4:30 pm #1280096Hey RosannaK,
Thank you for the inquiry.
There should be a max attribute value for the quantity field based on the available product stock, and users should not be able to exceed that limit. Did you modify the quantity field?
Example of the quantity field markup when there are only 5 products left.
<input type="text" id="quantity_60269095d0ef9" class="input-text qty text" step="1" min="1" max="5" name="quantity" value="1" title="Qty" size="4" placeholder="" inputmode="numeric">
As you will notice, the max attribute value is also set to 5.
Best regards,
IsmaelFebruary 12, 2021 at 8:14 pm #1280163This reply has been marked as private.February 15, 2021 at 2:47 pm #1280551Hi,
Thank you for the update.
Yes, users should not be able to add more items beyond the available stocks.
The login account exists but the password according to WP is incorrect. Please check the info carefully. The site is on maintenance mode, so were not able to check the site properly.
Best regards,
IsmaelFebruary 16, 2021 at 8:58 pm #1281534Hi Ismael,
Sorry about that. Here is correct information for access:I have double checked this access and it is working fine on my end so hopefully you will be successful this time.
Here is the product page I have been running the test on (I have set the stock as only 1 left in stock so you should not be able to add 2 items to the cart):
http://rkrstationer.ca/?product=lamy-studio-black-fountain-pen
Please let me know what is going wrong with the ‘Add to cart’ button.Thanks
- This reply was modified 3 years, 9 months ago by Ismael. Reason: moved login info to the private field
February 17, 2021 at 3:34 pm #1281759Hi!
Thank you for the info.
The stock quantity of the LAMY Studio Black Fountain Pen product was not defined, so we set it to 20 temporarily. This now limits the quantity field to 20 as well. Please check the following documentation to learn more on how to properly manage the inventory or stock level of a specific product.
// https://docs.woocommerce.com/document/managing-products/#inventory-tab
// https://docs.woocommerce.com/document/configuring-woocommerce-settings/#inventory-optionsRegards,
IsmaelFebruary 17, 2021 at 10:56 pm #1281883This reply has been marked as private.February 19, 2021 at 1:58 pm #1282219Hi,
Odd. The max attribute of the quantity field is already set to 1 but for some reason, it is still possible to add another item.
<input type="text" id="quantity_602fa7777391c" class="input-text qty text" step="1" min="1" max="1" name="quantity" value="1" title="Qty" size="4" placeholder="" inputmode="numeric">
This might be a bug in the quantity field script. Is it working correctly when you add more than 1 item or increase the stock level?
Thank you for following up.
Best regards,
IsmaelFebruary 19, 2021 at 8:18 pm #1282319This reply has been marked as private.February 23, 2021 at 12:01 pm #1283044Hi,
Thank you for the update.
The max attribute corresponds to the available stocks but for some reason, it is not working. Please try to edit the themes\enfold\config-woocommerce\woocommerce-mod.js, look for this code around line 72.
avia_apply_quant_btn();
Below, add this code.
$(".variations_form").on("woocommerce_variation_select_change", function () { avia_apply_quant_btn(); });
This should update the quantity buttons after selecting a different variation.
Best regards,
IsmaelFebruary 23, 2021 at 8:06 pm #1283210This reply has been marked as private.February 24, 2021 at 1:18 am #1283275This reply has been marked as private.February 26, 2021 at 1:53 pm #1283841Hi,
Thank you for following up.
It works fine when we disable the quantity button completely, and use the default buttons from the plugin. Would you consider disabling the quantity button modification? If yes, just remove all instances of the avia_apply_quant_btn(); function inside the woocommerce-mod.js file.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.