Custom action not working in Woocommerce

It looks like your call to remove_action() has too many parameters. https://codex.wordpress.org/Function_Reference/remove_action Also, your call to add_action() is set to allow 0 parameters but your woocommerce_breadcrumb() definition expects one so you need to fix that mismatch. https://codex.wordpress.org/Function_Reference/add_action I haven’t run the code locally but those are the only issues I’m seeing. I hope that helps … Read more

Woocommerce purchase date [closed]

I think your making it way too hard to save and extract that information from the database. I recommend you use a custom meta field for order, something like this: //Save it after the process add_action( ‘woocommerce_checkout_update_order_meta’, ‘purchase_date_save’ ); function purchase_date_save( $order_id ) { $get_current_date_time = date(‘Y-m-d’); update_post_meta( $order_id, ‘my_purchase_date’, sanitize_text_field( $get_current_date_time ) ); } … Read more

Which Multi-language option for WordPress is best from an SEO and Woocommerce perspective?

If you need true localization, like a different checkout process, different themes or product descriptions, then you should use a multisite. You can activate plugins and themes per site here. The problem here is that almost all shopping plugins are not multisite compatible. You have to activate them per site, not as network plugin, or … Read more

Disable woocommerce product search plugin’s autocomplete [closed]

You can do this by adding this bit of jQuery code, for example at your footer.php, right before the </body> tag closure: <script> $(‘input.field’).attr(‘autocomplete’, ‘off’); </script> Or the same thing but with pure JavaScript: <script> var x = document.querySelectorAll(“input.search-field”); for (i = 0; i < x.length; i++) { x[i].autocomplete=”off” } </script> This will add autocomplete=”off” … Read more

Change WooCommerce add_to_cart Button Text?

It’s not working because: get_the_terms( $post->ID, ‘product_cat’ ) yields an array of objects, to test against those objects you have to run a loop and pull a $term_id property out of each object. WordPress to the rescue! WordPress has a helper method for that… has_term(330,’product_cat’, $post); Use the has_term method to satisfy your conditional.

Get usermeta info from sql query

You can use meta_query to specify what conditions you want to meet with that query you are performing. i.e.: // grab some record from DB with a specific meta query $args = array( ‘post_type’ => array( ‘woo_commerce_something’ ), ‘orderby’ => ‘rand’, ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ => ‘meta_something_woo_commerce_email’, ‘value’ => ’email@[email protected]’ ) … Read more