Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // changes the "select options" text. fahimm.com
- add_filter( 'woocommerce_product_add_to_cart_text', function( $text ) {
- global $product;
- if ( $product->is_type( 'variable' ) ) {
- $text = $product->is_purchasable() ? __( 'More Options', 'woocommerce' ) : __( 'Read more', 'woocommerce' );
- }
- return $text;
- }, 10 );
- /**
- * remove add to cart buttons on the shop archive page
- */
- add_filter( 'woocommerce_loop_add_to_cart_link', 'replacing_add_to_cart_button', 10, 2 );
- function replacing_add_to_cart_button( $button, $product ) {
- if ( $product->is_type( 'simple' ) ) {
- $button_text = __("View product", "woocommerce");
- $button = '<a class="button" href="' . $product->get_permalink() . '">' .
- $button_text . '</a>';
- }
- return $button;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement