Woocommerce – Override the default templates location under the theme directory

I believe you can use the woocommerce_template_path hook/filter: // $path defaults to ‘woocommerce/’ (in your theme folder) add_filter( ‘woocommerce_template_path’, function( $path ){ $my_path = get_stylesheet_directory() . ‘/plugins/woocommerce/’; return file_exists( $my_path ) ? ‘plugins/woocommerce/’ : $path; } ); It should work whether you’re overriding only specific files or all — i.e. you copy all files and … Read more

Update html tag class values based on Woocommerce product attribute dropdown selection [closed]

You can use the following to add/remove a customized class to #primary selector based on the selected product attribute “Color”: <script type=”text/javascript”> jQuery(function($){ var p = ‘#primary’, c = $(p).prop(‘class’), s=”select[name=”attribute_pa_color”]”; // On start if( $(s).val() !== ” ) { $(p).prop(‘class’, ‘background-‘+$(s).val()); } // On select (blur live event) $(s).blur( function() { var b = … Read more

How do I hide the purchase note in the WooCommerce ‘order completed’ email?

I think you’re correct about that code snippet only checking the for the availability of the email. But you can probably still make your alternative approach work: the WC_Email classes set $sending to true when they’re in the process of sending. So you could check something like: WC()->mailer()->emails[“WC_Email_Customer_Completed_Order”]->sending

WooCommerce: The model of e-mail is displaying only the html, not css [closed]

Well, I tested a lot of WooCommerce versions (3.3.x, 3.4.x and 3.5.x) using WP Rollback and I believe that was a error in e-mail templates that was fixed in version 3.5.2. I didn’t found nothing in the changelog about that: https://raw.githubusercontent.com/woocommerce/woocommerce/master/CHANGELOG.txt Here is the template in WooCommerce in version 3.5.2: I have to investigate more … Read more

Show add to cart button on shop woocommerce

Point 1: To change “VEDI PRODOTTO” (view product) button instead of “Add to Cart” button on product archives: Put below code in functions.php file. remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’ ); add_action(‘woocommerce_after_shop_loop_item’, ‘add_a_custom_button’, 5 ); function add_a_custom_button() { global $product; if( $product->is_type(‘variable’) || $product->is_type(‘grouped’) ) return; echo ‘<div style=”margin-bottom:10px;”> <a class=”button custom-button” href=”‘ . esc_attr( $product->get_permalink() ) . … Read more

Remove Dashboard button from menu in my account page – WooCommerce

This requires 2 different hooked functions: The first function will remove the first my account menu item (which is the dashboard). The second function will redirect the default my account dashboard page to the first my account endpoint. The code: // Remove the first menu item (the dashboard) add_filter( ‘woocommerce_account_menu_items’, ‘account_menu_items_callback’ ); function account_menu_items_callback( $items … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)