Tagged: x
-
AuthorPosts
-
August 8, 2016 at 1:09 pm #1122505
vchangParticipantWhen viewing our Woocommerce Shop Page and positioning the mouse over a product image, some of them make a button appear that states “Select options” as shown in the attached pdf file. I’d like to fix this to match most of product images that make an “Add to cart” button appear instead.
I’d appreciate any help to learn how to correct this.
Thanks!
August 8, 2016 at 1:40 pm #1122562
RahulModeratorHey There,
Thanks for writing in!
Add this code at your child themeโs functions.php with your own customization 🙂
add_filter('woocommerce_loop_add_to_cart_link', function( $product ){ return sprintf( '<a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" data-quantity="%s" class="x-btn %s product_type_%s">%s</a>', esc_url( $product->add_to_cart_url() ), esc_attr( $product->id ), esc_attr( $product->get_sku() ), esc_attr( isset( $quantity ) ? $quantity : 1 ), $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '', esc_attr( $product->product_type ), esc_html( $product->add_to_cart_text() ) ); });Hope this helps!
August 9, 2016 at 1:11 pm #1124157
vchangParticipantThis reply has been marked as private.August 10, 2016 at 3:38 am #1125208
NicoModeratorHi There,
He means about the “with your own customization” is that you will add the code above with your other codes in the funcion.php.
Hope it is clear already and the code above will work ๐
Let us know how it goes.
Thanks.
August 11, 2016 at 1:40 pm #1127571
vchangParticipantThis reply has been marked as private.August 11, 2016 at 3:19 pm #1127672
JoaoModeratorYou too ๐
Let us know if you need help with anything else.
Joao
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1122505 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
