By default on single product page enabled option ‘controlNav’ = ‘thumbnails’. It’s ok for desktop. But on mobile i want to be ‘controlNav’ = true (dots). I tried to do it with ajax, but I think I need somehow refresh that fragment with flex slides to apply filter. I cant get it. in JS file: in functions.php: Answer The following
Tag: woocommerce
Combining multiple cart item permalink changes in WooCommerce
I would like to change the permalinks of my cart item using the WooCommerce framework. I have the following: function addCustomFieldToUrl_1($permaLink, $cart_item, $cartItemId){ …
Countdown timer until product sale ends on WooCommerce single product page
My goal with this, as I am learning, is to add a countdown timer after the add to cart form on the product page that counts down the time left until the sale is over. I’m using “How TO – JavaScript Countdown Timer” from the w3schools website and I wrote code for getting the _sale_price_dates_to using $sale_date = get_post_meta( $product->get_id(),
How to show all images in WooCommerce product description
I want to replace my product description by my description + all product images (include variation product images) in single product page. I can do that with Magento but now when change to Woocommerce …
Woocommerce minimum order total based on user roles
I’m using a snippet code from Woocommerce Minimum Order Amount to set a minimum order total. But I would like to set different minimums per user role. I have some custom user roles: wholesale_prices, wholesale_vat_exc, and distributor_prices. I want to make the code to work based on use roles with different minimum amounts for each role. Here is my code:
Limit WooCommerce products in cart only from one custom taxonomy
I’m trying to restrict customers on my Woocommerce store to only be allowed to order products from 1 “supplier” at a time. I am defining the “Supplier” by a custom taxonomy called &…
How to use WooCommerce is_shop conditional tag excluding searchs results
I have a function that uses the conditional tag is_shop. The function is intended to display a widget on the shop page only. However, it also returns the widget when a search is performed. Is there a way to only return it on the shop main page. My code is: I’ve tried using is_page as well with no joy. Answer
How to create a filter dropdown on WooCommerce admin orders list?
I am trying to create a shipping state filter dropdown on WooCommerce admin orders list First I have added a custom column for shipping state to admin orders list: And here’s my dropdown filter, for shipping state: And here’s my question: How to process the selected filter on admin orders list when I click the filter button? Answer There are
How to get WooCommerce shipping methods cost and settings?
I’m trying to get all shipping methods, with their rates and title. But when i use WC()->shipping->get_shipping_methods() it will only return empty rates array, and empty title string. Here is a dump: I tried to Google the issue, but nothing really helped. Does anyone know what could be the issue? Thanks a bunch! Answer Because WC()->shipping->get_shipping_methods() doesn’t load the shipping
Set a custom shipping cost on every 10th Order in WooCommerce
WP 5.3.3 I need to change shipping cost programmatically, after order creation. This code doesn’t affect: add_action(‘woocommerce_new_order’, ‘custom_shipping_costs’, 1, 1); function …