Woocommerce Shop page variation product button replace with add to cart button

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 __( … Read more

How to Update the Order-Items While Editing an Order on the WooCommerce Admin Order Screen [closed]

The woocommerce_order_before_calculate_totals hook executes in the Edit Order admin screen when an item is changed or the ‘recalculate’ button is pressed. This allows you to loop through each item and fee in the order and edit as required. I have a fee called ‘Deposit’ which I update if it exists or I add if it … Read more

Hide account tab to certain users

I’m not sure what the snippet you used is, but you can wrap it in an if statement like this: if(in_array(‘wholesaler’, wp_get_current_user()->roles)) { // Your snippet here } This will only run the snippet that adds that tab when the user that is logged in has the wholesaler role. Be sure to replace wholesaler with … Read more

WooCommerce add class name in the list [closed]

There is no particular hook available to deal with classes in products list. Therefore, we need to edit, “content-product.php” present in, “template” folder of “woocommerce” plugin. We can add following code: $product_id = get_the_ID(); $result = wp_get_post_terms($product_id,’product_cat’); if(!empty($result)){ $term = ”; foreach($result as $single_result) { $term .= ‘ ‘ . $single_result->slug; } $classes[] = $term; … Read more