Filter WooCommerce admin products list by a custom taxonomy

There is some missing parts in your code: Try the following: add_action(‘restrict_manage_posts’, ‘admin_products_by_manufacturer_filter_dropdown’); function admin_products_by_manufacturer_filter_dropdown() { global $typenow, $pagenow; $taxonomy = ‘vyrobca’; // The custom taxonomy if( ‘edit.php’ === $pagenow && ‘product’ === $typenow && taxonomy_exists( $taxonomy ) ) { $info_taxonomy = get_taxonomy($taxonomy); $selected = isset($_GET[$taxonomy]) ? $_GET[$taxonomy] : ”; wp_dropdown_categories( array( ‘show_option_all’ => sprintf( … 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

get current product name in functions.php

Please check below code : add_action( ‘woocommerce_single_product_summary’,’content_after_addtocart_button’ ); function content_after_addtocart_button() { global $product; $product_title = $product->get_name(); $product_price = $product->get_price(); echo ‘<div class=”content-section”> <a href=”https://wordpress.stackexchange.com/questions/340361/mailto:[email protected]?&subject=Richiesta Informazioni&body=” . $product_title . ‘??? ‘ . $product_price . ‘ ??? “> <input type=”button” value=”Richiedi Informazioni”/ ></a></div>’; }

Custom attribute type not displaying terms in edit product – WooCommerce

I just had that problem and resolved it alone since i could not find the answer online. You just need to put that code inside an if. Only to run that code on attribute page. if ($_GET[‘page’]==’product_attributes’) { add_filter( ‘product_attributes_type_selector’, function($array){ $array[‘test’] = __( ‘Test’, ‘awcs’ ); } ); }

How to configure two SMTP Server for wordpress

Disclaimer: this is clumsy, someone might have a better suggestion. But here’s one idea: Leave WordPress configured with your [email protected] settings. Set up Woo with the [email protected] address (WooCommerce -> Settings -> Emails -> From Address). Hook woocommerce_mail_callback with your own function that temporarily hooks phpmailer_init to change the SMTP configuration before calling wp_mail. Or … 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