Home Forums WoodMart support forum Add to cart doesnt work anymore B2B

Add to cart doesnt work anymore B2B

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #446821

    daniel-3289
    Participant

    Upon implementing this feature (https://wholesalesuiteplugin.com/kb/add-min-quantity-archive-pages-adding-quantity-selector/) for our B2B / B2C store.
    We lose the functionality to click the “add to cart” this seems to be an issue between wholesale suite and the theme, upon using another theme it works just fine.

    The interesting thing is that it does add the quantity selector, but you just cannot buy anymore.

    Kindly advise. Kind regards,

    #446972

    Artem Temos
    Keymaster

    Hi,

    Could you please send us a link to your website where we can see this issue?

    Kind Regards

    #448268

    daniel-3289
    Participant

    Yes i can!

    Item; Angst is mar veur eben has a min order of 6.

    I have enabled the code snippet you can find here, to make sure when buying from archive page, it will also increment by 6.
    /**
    * Override loop template and show quantities next to add to cart buttons
    */
    add_filter( ‘woocommerce_loop_add_to_cart_link’, ‘quantity_inputs_for_woocommerce_loop_add_to_cart_link’, 10, 2 );
    function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) {
    if ( $product && $product->is_type( ‘simple’ ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) {
    $html = ‘<form action=”‘ . esc_url( $product->add_to_cart_url() ) . ‘” class=”cart” method=”post” enctype=”multipart/form-data”>’;
    $html .= woocommerce_quantity_input( array(), $product, false );
    $html .= ‘<button type=”submit” class=”button alt”>’ . esc_html( $product->add_to_cart_text() ) . ‘</button>’;
    $html .= ‘</form>’;
    }
    return $html;
    }

    Ideally i don’t even want that script, as it makes a very ugly overlay on the items. But the functionality is important to us.

    If you want to test it without the script running, feel free to login and switch to the main theme.

    • This reply was modified 1 year, 9 months ago by Artem Temos.
    #448554

    Artem Temos
    Keymaster

    Hello,

    Please, share all your website information using our private content field only. It will make it visible to our staff and not the public.

    Could you please reproduce the same look on the default WordPress theme so we can see how it works there?

    Thank you in advance.

    #452366

    daniel-3289
    Participant

    Yes i can, i have now added the byvex woocommerce starter + the functions.php script. And in there you can go to https://staging-loopvis.nl/product-categorie/kakkerlakjes

    And see that it works perfectly fine 🙂

    you do have to be logged in with the login (retailer) info provided earlier 🙂

    #452533

    Artem Temos
    Keymaster

    Hello,

    Could you please check how it works on your website now?

    Kind Regards

    #452619

    daniel-3289
    Participant

    It works, thanks, we will look into restyling it so it suits our needs. But it works perfectly well!

    What was the issue?

    #452621

    Artem Temos
    Keymaster

    The problem was caused by “AJAX add to cart” which conflicts with your custom code.

    Kind Regards

    #452622

    daniel-3289
    Participant

    aah, perfect thanks!~

    Is it correct though that the add to cart has been moved below the text, whereas it was below the image before?

    #452645

    Artem Temos
    Keymaster

    Yes, we changed the product style in Theme Settings for tests. But you are free to change it back. It should work with the previous style as well.

    Kind Regards

    #453994

    daniel-3289
    Participant

    Perfect! Have fixed it! thanks for your help!

    #454322

    Artem Temos
    Keymaster

    You are always welcome. Feel free to contact us if you have any further questions.

Viewing 12 posts - 1 through 12 (of 12 total)

The topic ‘Add to cart doesnt work anymore B2B’ is closed to new replies.