Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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

    #1280096

    Hey 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,
    Ismael

    #1280163
    This reply has been marked as private.
    #1280551

    Hi,

    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,
    Ismael

    #1281534

    Hi 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
    #1281759

    Hi!

    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-options

    Regards,
    Ismael

    #1281883
    This reply has been marked as private.
    #1282219

    Hi,

    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,
    Ismael

    #1282319
    This reply has been marked as private.
    #1283044

    Hi,

    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,
    Ismael

    #1283210
    This reply has been marked as private.
    #1283275
    This reply has been marked as private.
    #1283841

    Hi,

    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

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.