3 votes

How to unhook a function in Woocommerce Template?

remove_action requires that the second parameter is the name of the function/callable that was added, and the priority must match what was added. The official documentation says its parameters are: ...
user avatar
  • 52.4k
3 votes
Accepted

How to unhook a function in Woocommerce Template?

You need to unhook the function from that action specifically: remove_action( 'woocommerce_review_before_comment_meta', 'woocommerce_review_display_rating', 10 ); (e.g. look for the ...
user avatar
  • 3,415
2 votes

how customise Woocommerce style of custom theme

You can add your own css based on the classes created by WooCommerce. If you are working in a (child)theme, you can add a stylesheet by adding this code in functions.php: /** * Enqueue your own ...
user avatar
  • 21
2 votes
Accepted

paypal not showing on woocommerce payments

Paypal standard is now hidden for new installs, possible to read about it in https://developer.woocommerce.com/2021/07/12/developer-advisory-paypal-standard-will-be-hidden-on-new-installs/ for those ...
user avatar
2 votes
Accepted

Woocommerce: Complex query in pre_get_posts

When I have complex querie to do, I often use a prequery to get the good post_ids. Then I pass this list of post_ids to my main query via the post__in parameter of WP_Query. $meta_key = 'RepeaterName_%...
user avatar
  • 198
2 votes
Accepted

Using a filter to change a path

Create the template you want to use, say wc-vp-table-rows.php, put it in your theme, and add the following to your functions.php: add_filter( 'wcvendors_pro_table_display_rows_path', fn() =&...
user avatar
  • 105k
2 votes

600k of option_name "c_facebook_background_product_sync_job"

Use phpmyadmin to make a backup of the wp_options table. Then run the same command again, but replace SELECT COUNT(*) with DELETE
user avatar
  • 4,900
2 votes
Accepted

Categories are not listing their respective products

Normally, while creating a store, you'd go with the third choice, items and categories/subcategories. This means that users can either choose products directly from the main page or refine their ...
user avatar
1 vote

Add item to the woocommerce dashboard menu from a plugin

try this code. Paste in to function.php add_action('admin_menu', 'custom_page'); function custom_page() { add_submenu_page( 'woocommerce', 'Name of page', 'Name of item', 'manage_options', 'custom-...
user avatar
1 vote
Accepted

WooCommerce single products images doesn't zoom on hover and doesn't change clicking on gallery

my solution works for who makes a theme from zero (not using WordPress ready themes) make a Backup from your WordPress theme go to wp-content/plugins/woocommerce and find and copy a directory which ...
user avatar
  • 26
1 vote

Add html link in functions.php files of the theme

You are missing a closing tag for the opening link (<a>) tag, try: function filter_woocommerce_checkout_must_be_logged_in_message( $message ) { $message = '<span>You must be <a href=...
user avatar
  • 3,343
1 vote

Order with custom order status disappeared once the page is refreshed

My bad, I was using add_filter() instead of add_action() in 'init' hook. The following link is the perfect solution for adding custom order status and email notification. My Woocommerce version is ...
user avatar
1 vote

WooCommerce Product detail page: Add content under thumbnails

In woocommerce/templates/content-single-product.php you can see that woocommerce_show_product_images is hoooked with a priority of 20. if you want your custom function to render below the images, but ...
user avatar
  • 381
1 vote
Accepted

require_once() if a product in woocommerce contains a tag

has_term() is a template function therefore it does not work if you use it straight in functions.php which is loaded well before knowing if the current object is a product page. So if you use it in ...
user avatar
1 vote
Accepted

How to change woocommerce checkout privacy policy, terms and condition text

After some digging in WooCommerce github and WordPress github I can say that there isn't a filter, in WooCommerce, to change that specific text. What you can do is hook into pre_kses, because that ...
user avatar
1 vote

Customize WooCommerce Add To Cart Form Name

Yes, you can do it using the override woocommerce template. Guide to override template - https://zemez.io/support/wordpress/how-to/override-woocommerce-template-files/ Once you copy templates/single-...
user avatar
1 vote

Woocommerce Email show HTML source code

The problem was indeed in the settings from my SMTP host (Elastic Email). They also had a update but the 'Auto' function doesn't work properly. You have to change it to html/text and Woocommerce ...
user avatar
1 vote

How do I make a diagonal strikethrough on wordpress?

The html structure for WooCommerce original price, if sale price exists is this. <del> <span class="woocommerce-Price-amount amount"> <bdi> <span ...
user avatar
1 vote
Accepted

Can't filter out variable products in sale from wp_get_products loop (or shortcode)

Ok, after some digging around I've finally found the answer I was looking for. Turns out there is a function called wc_get_product_ids_on_sale() you can use to exclude those ID's from wc_get_products. ...
user avatar
  • 619
1 vote

Add SKU in Product Title

In the above code. You are adding the SKU code on all the product on every post saved. Instead of all post you should just update only product which you are updating. And send you should check if SKU ...
user avatar
1 vote

How to add product filter dropdown in woo commerce order page?

Here is solution for above questions // Custom function to get the product names, that appear in the existing orders function get_product_names() { global $wpdb; return $wpdb->get_col(" ...
user avatar
1 vote
Accepted

How to optimize update_post_meta?

To achieve what you want you're better creating an associative array and then walking over it with a foreach loop as shown below : $data = array( '_shipping_first_name' => $order->...
user avatar
  • 1,059
1 vote

Woocommerce. Max weight per order based on shipping class

This will do it: add_action('woocommerce_check_cart_items','check_cart_weight'); add_action('woocommerce_checkout_process', 'check_cart_weight' ); function check_cart_weight() { $cart = WC()-&...
user avatar
1 vote

Remove WooCommerce block styles

The dequeue handle is incorrect it should be wp_dequeue_style('wc-block-style'); and not wp_dequeue_style('wc-block-style-css'); A bit confusing at first i agree, every js and css that was enqued via ...
user avatar
1 vote

WooCommerce - Add product with image via REST API

instead of 'sslverify' 'verify_ssl' => false,
user avatar
1 vote
Accepted

Absolute Image URL in srcset is appended to the upload dir

I guess you worked around that issue - still I stumbled over your post having the same issue. I was able to work around by applying a bugfix from woozone itself - in your wordpress solution with ...
user avatar
  • 126
1 vote
Accepted

Get product attribute for Simple product in WooCommerce

Building on Loic's answer for an attribute of pa_manufacturer: if ( get_post_type( $post ) === 'product' && ! is_a($product, 'WC_Product') ) { $product = wc_get_product( get_the_id() ); // ...
user avatar
  • 392
1 vote

Getting categories id for all products in cart

The answer from @sally works great, as long as your products are Simple products. If your product uses a variation, then the above code no longer works as the $cart_item['data'] does not return the ...
user avatar
1 vote

Add custom body tag if product is out of stock

I have updated the code from @Adnrea Somovigo and customize it, to display body classes, based on stock_status, not on stock_quantity. So this should work also for in-stock, on-backorder and out-of-...
user avatar
  • 11
1 vote

Are there any hook or filter when refund is done through admin -woocommerce

My answer is for emails or when refunds are done through the payment gateway but it might help someone coming across this. So in addition to Tech Dog's answer You can use a few other hooks ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible