Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #2581689
Ajax add to Cart Notifications
Closed

Comments

  • Paul Schiretz started the conversation

    Hi there, i use your Ajax add to Cart plugin and it works great, it seems you basically recycled the quadlayers code, thanks!

    What really bugs me is that the notices from woocommerce are not displayed after add to cart. Like if a product is not purchasable anymore, cause the user already has to many of a product in the cart or similar.

    Should be easy for you to get the notices from the ajax response.
    Here is a real nice example: https://aceplugins.com/ajax-add-to-cart-button-on-the-product-page-woocommerce/ part1 is basically the same you do except line 50 and onwards, this is where the Notices are fetched, part3 describes how to clear and display them.

    It would be really nice if we could have the notices as well, otherwise it seems bit too hacky to me, to just don’t show any error what so ever to the user.

    All the Best and keep up the good work,
    Paul

  •  767
    Janilyn replied

    Hi Paul,

    Thanks for your useful information. 

    I will transfer your ticket to the major developer of our plugin so that he can further consider and make suitable adjustments. Our developer will respond to your ticket as soon as he reaches your ticket.

    Have a nice day and best regards.

    Janilyn T. - WPClever Support Agent

  •  1,223
    Dustin replied

    Hi Paul,

    I tried this code in the theme/functions.php but it doesn't work https://www.screencast.com/t/aUHBlN4JP6SV

    To get the notice after adding to the cart, please try another plugin from us https://wordpress.org/plugins/woo-added-to-cart-notification/. It works together with WPC Ajax Add to Cartbigsmile.png

    Best regards,
    Dustin

  • Paul Schiretz replied

    Hi Frankie,

    Hmm, thanks for trying that out. I already use the woo-added-to-cart-notification plugin, all fine with that. My problem is mainly that if something goes wrong like there is only one product left in stock and you press the add to cart button twice there is no feedback what so ever that something didn't work out. The woo-added-to-cart-notification still pops up and says everything is ok, but when you reload the page you see all the woo error messages, or worse of you go to the cart page all errors popup at the same page.

    Easily reproduceable:

    1. Generate a product with the stock of 1
    2. Press "Add to cart" 2 times, on the single product page
    3. Reload the page


    I'm sorry that the code didn't work out like it should. Strange that you got an error in success.php, when i tried it didn't come up... 

    Line 22(at leaset in my woocommerce install(current version)): 

    if ( ! $notices ) {
    return;
    }

    So i really don't get why it should trigger an undefined variable here... but your i can't help with that without seeing the code...

    Isn't there any way you can fetch the error messages after the add to cart button is pressed and display them as notifications? Or at least fetch them and display them instead of the added to cart notification?

    i really think that something like this would be a very important addition to your plugin, cause handling all the success cases is only half the plugin ;-)

    All the Best,

    Paul

  •  1,223
    Dustin replied

    Thank you so much!

    I've fixed our plugin WPC Ajax Add to Cart, please update this plugin to latest version 1.1.4, clear the cache before testing again.

    You can watch the screen record video here https://www.dropbox.com/s/ql4oq3w1nzssfvb/Screen%20Recording%202020-11-04%20at%2016.00.15.mov?dl=0

    Best regards,
    Dustin

  • Paul Schiretz replied

    Thank you very much! Works exactly how it should! :-)


    All the Best,

    Paul

  •  1,223
    Dustin replied

    You're welcome!smile.png
    Feel free to submit a new ticket if you have any questions when using our plugin.

    If you are satisfied with our plugin and support, please reward it with a full five-star ★★★★★ rating.
    https://wordpress.org/support/plugin/wpc-ajax-add-to-cart/reviews/?filter=5
    Thank you in advance! <3

    Best regards,
    Dustin