Category : woocommerce

I have below code to change "place order" button text on checkout for a specific product ID: add_filter( ‘woocommerce_order_button_text’, ‘ros_custom_button_text_for_product’ ); function ros_custom_button_text_for_product( $button_text ) { $product_id = 363053; // a specific product ID you would like to check if( WC()->cart->find_product_in_cart( WC()->cart->generate_cart_id( $product_id ) ) ) { $button_text = ‘Preauthorize’; } return $button_text; } The ..

Read more

I have displayed some custom fields in the front-end of woocommerce products and customers can fill the fields and add items to the cart, and then checkout. Here is the product screen: and this is checkout screen: Here is my full code: /** * Show custom fields in products */ add_action( ‘woocommerce_before_add_to_cart_button’, ‘add_fields_before_add_to_cart’ ); function ..

Read more

I am trying to add the function so customers can switch the variation of product in active subscrption under woocommerce account. Right now i am using Self-service dashboard for woocommerce subscription plugin that does something i want, however it is showing switch button function for subscription variable type of product, not for variable product. How ..

Read more

In our Woocommerce theme, we have a nugget of code which appears to assign an html class with a setTimeout logic, before it will allow HTML to become visible: $( function(){ blockshop.init(); setTimeout( function(){ $( "html" ).addClass( "page-loaded" ) $( ‘.shop-header-wrapper’ ).addClass( ‘visible’ ) }, 50 ); Obviously, this probably isn’t ideal from an SEO ..

Read more

I am using Product Bundles for Woocommerce, and I need to add products to the cart via ajax. That is something I took care of by following this tutorial: https://www.divikingdom.com/ajax-add-to-cart-woocommerce-product-archive/ The thing is, I also want to have 2 buttons on my product page once the product is added to the cart. One for View ..

Read more