New answers tagged

0 votes

Woocommerce check if email already created order recently

You can create a helper function for that which qurries the orders for given email and created less than 10 mins ago. function wpse407278_check_if_ordered_in_last_10_mins() { $args = array( ...
user avatar
  • 2,694
0 votes

Hiding products with a specific tag and traffic UTM parameter from WooCommerce main shop page

You'll need a custom theme or child theme to work from. From there, you should be able to edit something like shop.php or whatever template is being used for the shop to include a conditional: <?...
user avatar
  • 8,683
0 votes

woocommerce axios react

It's old question but maybe it works for who struggle with this problem. You can use woocommerce 's own api (https://woocommerce.github.io/woocommerce-rest-api-docs/) // Install: // npm install --save ...
user avatar
  • 1
0 votes

Conditionally run function based on custom meta value?

Instead of conditionally adding an add_action() call, you can just add it and run the function it hooks to—its callback—conditionally instead. For example: add_action( '...
user avatar
  • 10.4k
1 vote
Accepted

A function to add arguments to a taxonomy

Use the filter register_taxonomy_args to manipulate the arguments used for registering the taxonomy just before it is registered: function wpse_406824_vendor_taxonomy_args( $args, $name ) { if ( $...
user avatar
  • 35.6k
0 votes

Retrieve Data from Custom Endpoint

As you said "Coupon is created in WooCommerce end", we can confirm that custom endpoint "webhook" is working finely. The issue is regrading to retrieve Email Address from the ...
user avatar
  • 11
0 votes

How to show or hide all payment methods on cart screen?

It turns out that PayPal has multiple payment options for WooCommerce. I chose "PayPal Checkout" and clicked on "Setup" Then I found a checkbox for "Enable on Cart" - I ...
user avatar
  • 282
0 votes

woocommerce Shortcodes - Change display between mobile and Desktop

@media (max-width: 544px) { .woocommerce ul.products:not(.elementor-grid).columns-3, .woocommerce-page ul.products:not(.elementor-grid).columns-3 { grid-template-columns: repeat(2,minmax(0,1fr)); }...
user avatar
1 vote
Accepted

How to set the meta description of a WooCommerce product as its primary category description?

Use the wpseo_metadesc filter: function wpse_406559_product_meta_description_from_category( $description ) { if ( ! is_singular( 'product' ) || $description ) { // Bail early if not single ...
user avatar
  • 35.6k
1 vote
Accepted

Change product_base programmatically

Use your plugin activation hook to make the change. That will only run once, when your plugin is first activated, allowing the user to overwrite that change later (if they want to). ...
user avatar
  • 35.6k
0 votes

Display Sale Price Before Regular Price (WooCommerce)

I have tried it myself and this is my price.php code. You just need to add some css as per your need. First, remove the existing code '<p class="'.esc_attr( apply_filters( '...
user avatar

Top 50 recent answers are included