I am currently making an e-commerce on woocommerce. On my Shop/Catalog page, I used variation products which display select options button I need to remove this button to add to cart button.
1 Answer
Do you mean you need to replace the button of select options with add to cart
Please check below code
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_select_options_text' );
function custom_select_options_text() {
global $product;
$product_type = $product->product_type;
switch ( $product_type ) {
case 'subscription':
return __( 'Options', 'woocommerce' ); /*change 'Options' for Simple Subscriptions */
case 'variable-subscription':
return __( 'Options', 'woocommerce' ); /*change 'Options' for Variable Subscriptions */
case 'variable':
return __( 'Options', 'woocommerce' ); /*change 'Options' for Variable Products */
case 'simple':
return __( 'Add to Cart', 'woocommerce' ); /*change 'Add to Cart' for Simple Products */
break;
}
}
-
-
-
Pratik Bhatt this been change only text, not functionality I want Select options button to replace with add to cart functionality. Jul 25, 2018 at 5:56
-
I think it will not be possible as you need to select the options before adding the product to cart Jul 25, 2018 at 6:05