1

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

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;
      }
  }
  • Yes that I want – gautam dutta Jul 25 '18 at 5:45
  • Edited answer please check – Pratik Bhatt Jul 25 '18 at 5:54
  • Pratik Bhatt this been change only text, not functionality I want Select options button to replace with add to cart functionality. – gautam dutta Jul 25 '18 at 5:56
  • I think it will not be possible as you need to select the options before adding the product to cart – Pratik Bhatt Jul 25 '18 at 6:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.