- This topic has 23 replies, 5 voices, and was last updated 1 year, 3 months ago by
Tom.
-
AuthorPosts
-
February 2, 2021 at 1:08 am #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
February 2, 2021 at 8:47 am #1643196David
StaffCustomer SupportHi 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.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 3, 2021 at 12:22 am #1643831nik9
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',
February 3, 2021 at 9:55 am #1644512Tom
Lead DeveloperLead DeveloperWill 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 π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 3, 2021 at 2:02 pm #1644802nik9
Thanks Tom. π
March 9, 2021 at 12:04 am #1687610nik9
Hello Tom,
Any feedback on this? π
Cheers
March 9, 2021 at 10:11 am #1688531Tom
Lead DeveloperLead DeveloperWe 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 π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 10, 2021 at 11:41 am #1690182Tom
Lead DeveloperLead DeveloperAn 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 );
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 11, 2021 at 8:20 am #1691381nik9
Thanks tom,
When is the public version available? π
Cheers
March 11, 2021 at 8:31 am #1691395David
StaffCustomer SupportHi 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 30, 2021 at 4:05 am #1715083nik9
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 );
March 30, 2021 at 7:41 pm #1716072Elvin
StaffCustomer SupportHave 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.
A wise man once said:
"Have you cleared your cache?"March 31, 2021 at 1:43 am #1716285nik9
Hello Elvin,
Yes, i updated Gp theme. GP Premium is on version 1.12.3. I also cleared the cache.. not working π
March 31, 2021 at 8:47 am #1716875Leo
StaffCustomer SupportAs Tom mentioned in the first sentence here:
https://generatepress.com/forums/topic/add-to-cart-banner-not-showing-on-bundle-products/#post-1690182The code requires GPP 2.0 which is currently in beta:
https://generatepress.com/introducing-the-gp-theme-builder/Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 31, 2021 at 12:10 pm #1717066nik9
Oh, i miss that. I thought i have to update the GP Theme. Sorry.. then I will wait π
-
AuthorPosts
- You must be logged in to reply to this topic.