[Support request] Add to cart banner not showing on bundle products

Home Forums Support [Support request] Add to cart banner not showing on bundle products

Home Forums Support Add to cart banner not showing on bundle products

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #1642531
    nik9

    Hello,

    We use a plugin called “WPC Product Bundles for WooCommerce” (https://wordpress.org/plugins/woo-product-bundle/) in order to create product bundles. Works perfect! But we just noticed, that on product bundle single pages the “Add to cart” banner is not showing up. On normal product single pages we do not have that issue.

    I guess this is because of a different product type. How can we fix that?

    Cheers

    #1643196
    David
    Staff
    Customer Support

    Hi there,

    the Sticky Add to Cart only works with Simple, variable and external product types.
    And i don’t think that can be currently changed… if you can find out from the product developer what product_type their using we can take a look at integrating that in a woo update.

    #1643831
    nik9

    Hi,

    As far that I can understand the code they use “bundle” or “woosb” for taht type.

    if ( ! class_exists( 'WPCleverWoosb' ) && class_exists( 'WC_Product' ) ) {
    
    	class WPCleverWoosb {
    
    		protected static $_instance = null;
    
    		protected static $_types = array(
    
    			'bundle',
    
    			'woosb',
    #1644512
    Tom
    Lead Developer
    Lead Developer

    Will need to run some tests here. As of right now, there aren’t any filters available that we can use. However, I’ve added one in 1.13.0 that we should be able to use for this πŸ™‚

    #1644802
    nik9

    Thanks Tom. πŸ™‚

    #1687610
    nik9

    Hello Tom,

    Any feedback on this? πŸ™‚

    Cheers

    #1688531
    Tom
    Lead Developer
    Lead Developer

    We did add some more filters here in 2.0.0, which is currently in alpha testing: https://generatepress.com/introducing-the-gp-theme-builder/

    If you’d like to try out the alpha, we can try to sort out the filters that you need πŸ™‚

    #1690182
    Tom
    Lead Developer
    Lead Developer

    An example of how this would work in 2.0.0:

    add_filter( 'generate_wc_sticky_add_to_cart_action', function( $action, $product ) {
        if ( $product->is_type( 'bundle' ) ) {
            $quantity_buttons = '';
    
            if ( generatepress_wc_get_setting( 'quantity_buttons' ) ) {
                $quantity_buttons = ' do-quantity-buttons';
            }
    
            $args = array(
                'min_value' => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ),
                'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ),
            );
    
            $action = sprintf(
                '<form action="%1$s" class="cart%2$s" method="post" enctype="multipart/form-data">
                    %3$s
                    <button type="submit" class="button alt">%4$s</button>
                </form>',
                esc_url( $product->add_to_cart_url() ),
                $quantity_buttons,
                woocommerce_quantity_input( $args, $product, false ),
                esc_html( $product->add_to_cart_text() )
            );
        }
    
       return $action;
    }, 10, 2 );
    #1691381
    nik9

    Thanks tom,

    When is the public version available? πŸ™‚

    Cheers

    #1691395
    David
    Staff
    Customer Support

    Hi there,

    we at least another 2 – 3 weeks of testing before we reach a release candidate. So this time in April at the latest would be a good bet.

    #1715083
    nik9

    Hello, We just updated to the new version. How we can now adjust this new settings? πŸ™‚

    add_filter( 'generate_wc_sticky_add_to_cart_action', function( $action, $product ) {
        if ( $product->is_type( 'bundle' ) ) {
            $quantity_buttons = '';
    
            if ( generatepress_wc_get_setting( 'quantity_buttons' ) ) {
                $quantity_buttons = ' do-quantity-buttons';
            }
    
            $args = array(
                'min_value' => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ),
                'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ),
            );
    
            $action = sprintf(
                '<form action="%1$s" class="cart%2$s" method="post" enctype="multipart/form-data">
                    %3$s
                    <button type="submit" class="button alt">%4$s</button>
                </form>',
                esc_url( $product->add_to_cart_url() ),
                $quantity_buttons,
                woocommerce_quantity_input( $args, $product, false ),
                esc_html( $product->add_to_cart_text() )
            );
        }
    
       return $action;
    }, 10, 2 );
    #1716072
    Elvin
    Staff
    Customer Support

    Have you tried running the code?

    It should’ve been working once you’ve updated.

    Is the code not working even after the GP Premium update? Let us know.

    #1716285
    nik9

    Hello Elvin,

    Yes, i updated Gp theme. GP Premium is on version 1.12.3. I also cleared the cache.. not working πŸ™

    #1716875
    Leo
    Staff
    Customer Support
    #1717066
    nik9

    Oh, i miss that. I thought i have to update the GP Theme. Sorry.. then I will wait πŸ™‚

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