• Resolved amoozesh3.ir

    (@kama90)


    Hello.
    I activated Redirect to Checkout(Immediately redirect to checkout after adding an item to the cart)
    There is a bug :
    When I press the browser back button, and again I click on the same checkout, number of purchase same items added.I want to sell single item.
    as you can see pictured below:
    https://s2.picofile.com/file/8370780550/Items.png

    I would be grateful if you could help me and fix the problem.

    Best Regards,
    Ahmad Karimi

    • This topic was modified 5 years, 6 months ago by amoozesh3.ir.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi @kama90

    As per your screenshot it looks like that you have not enabled “Item Quantities”.

    Please navigate to Plugin Settings > Misc. Enable the option “Cart Item Quantities”.

    Now if you have multiple same items in cart then it will be displayed with quantity box.

    Thread Starter amoozesh3.ir

    (@kama90)

    Hi @pratik-jain

    Thanks for your response.
    My site’s products are android apps.
    I don’t want to sell an app to one person several times. I just want to sell single item.

    There is a bug :
    When I press the browser back button, and again I click on the same checkout, number of purchase same items added.
    as you can see pictured below:
    https://s2.picofile.com/file/8370780550/Items.png

    How can I fix the problem?

    Hi @kama90

    Actually this is not a bug. Can you please provide me your website product page URL? so I can take look at it and try to understand the scenario.

    Thread Starter amoozesh3.ir

    (@kama90)

    Hi @pratik-jain

    Thanks for your response.

    My website product page:
    https://amoozesh3.ir/

    Hi @kama90

    I have checked your provided link and all looks good. Now it is working file. I have checked this product link.

    It looks like that you have changed the plugin settings “Immediately redirect to checkout after adding an item to the cart”.

    Thread Starter amoozesh3.ir

    (@kama90)

    Hi @pratik-jain.
    Thanks for your response.
    Yes I have changed the plugin settings “Immediately redirect to checkout after adding an item to the cart” but I’m not satisfied from this state.
    Please check it again.

    My website product page:
    https://amoozesh3.ir/

    There is a bug :
    When I press the browser back button, and again I click on the same checkout, number of purchase same items added.
    as you can see pictured below:
    https://s2.picofile.com/file/8370780550/Items.png

    How can I fix the problem?

    Hi @kama90

    It looks like that it is a browser specific issue. I faced the same thing in Mozilla Firefox but in Google Chrome it is working fine.

    Can you please verify it?

    Thread Starter amoozesh3.ir

    (@kama90)

    Hi @pratik-jain.
    Thanks for your response.
    No.I don’t verify at all.
    I faced the same thing in Mozilla Firefox and Google Chrome.

    My website product page:
    https://amoozesh3.ir

    There is a bug :
    When I press the browser back button, and again I click on the same checkout, number of purchase same items added.
    as you can see pictured below in Google Chrome:
    https://s2.picofile.com/file/8370780550/Items.png

    Hi @kama90

    Thanks for your response.

    Have you checked it in a Mozilla Firefox. It looks like that various browser have different behavior.

    Do you want only single product quantity to buy? Does user can buy different different product at a time?

    Just want to check if there is any way from custom code? If you want only single product at a time to purchase then it can be a little easy.

    Thread Starter amoozesh3.ir

    (@kama90)

    Hi @pratik-jain
    Thanks for your response.
    Yes I want to only single product at a time to purchase.

    My site’s products are android apps.
    I don’t want to sell an app to one person several times. I just want to sell single item.

    There is a bug :
    When I press the browser back button, and again I click on the same checkout, number of purchase same items added.
    as you can see pictured below:
    https://s2.picofile.com/file/8370780550/Items.png

    • This reply was modified 5 years, 5 months ago by amoozesh3.ir.

    Hi @kama90

    Thanks for your response.

    For your query,
    1) Yes I want to only single product at a time to purchase.
    Ans – Yes, It can be done via little custom code.

    2) I don’t want to sell an app to one person several times. I just want to sell single item.
    Ans – It means two different apps can be purchased at a same time?

    Please let me know your thoughts.

    Thread Starter amoozesh3.ir

    (@kama90)

    Hi @pratik-jain
    Thanks for your response.
    Please just provide custom code for number 1:
    Ans – Yes, It can be done via little custom code.

    Thread Starter amoozesh3.ir

    (@kama90)

    Hi @pratik-jain
    Thanks for your response.
    Please provide custom code for number 1:
    Ans – Yes, It can be done via little custom code.

    Hi @kama90

    Sorry for my delay response. Please use below code. Please use this code to your theme / child theme functions.php file.

    It will flush the whole cart and add the new product in it.

    // Empty cart if user has added product
    function edd_flush_before_add_to_cart( $download_id, $options ) {
    	edd_empty_cart(); // Empty the shopping cart
    }
    add_action( 'edd_pre_add_to_cart', 'edd_flush_before_add_to_cart', 10, 2 );
    Thread Starter amoozesh3.ir

    (@kama90)

    Hi @pratik-jain
    You are a genius.
    Thanks for the code.
    It works very well.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘I want to sell single item’ is closed to new replies.