Questions tagged [woocommerce]

WooCommerce is an open source eCommerce plugin available for WordPress. Questions should relate to programming which changes or extends WooCommerce behaviour.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

Apply different coupon discount percent depending product tag woocommerce

I have created a code for apply diferent discount on cart depending if the product contains tag "big", only when coupon "resellers" is active on cart. Default code discount: 50% Code discount when ...
0
votes
1answer
12 views

React Native: How to render muliple images dynamically after fetching from multiple rest api's

I am unable to render multiple images fetched from multiple calls to rest API in react native. For Rest API reference, I am using woocommerce rest API for getting order details. https://woocommerce....
0
votes
0answers
16 views

Is it possible to retrieve count of products from each category in an order using woocommerce and mysql?

Newbie here, just like you've been once. I found the following code to retrieve all the product items from orders, but I'd like to also retrieve how many products of each parent-category there is in ...
0
votes
0answers
16 views

Create function Woocommerce check if checkout processed has an error

I am working on Woocommerce function if the process upon checkout has an error. I used this action but it did not display the way i want to, though there is an error with the promocode. add_action( '...
0
votes
0answers
21 views

Search products by OR condition

I want to search products by title or description or any taxonomy. I figure that tax query can help me with or condition but what if i want all with OR condition. $string = $_GET['s']; $args =...
-1
votes
0answers
18 views

Unsaved orders created by admin not showing up in Woocommerce

I can't find an order created by admin which have no saving (create order->add an item->leave the page without save), and noticed that product stock number has been deducted!! How can I access those ...
-1
votes
0answers
8 views

WooCommerce Orders of Specific City to Specific Shop Manager

Is there any way that I restrict the specific shop manager to see and manage orders of specific city?
0
votes
0answers
7 views

Woocommerce bundle product query

Is there any plugin for create bundle product like Magento in Woocommerce. Actually I need to create a main product and under this main product there is option A(dropdown) - under option A there is ...
-1
votes
0answers
9 views

Woocommerce intercept all REST API petitions

I would like to know if there is a way to intercept all REST API petitions of the Woocommerce API, so that I could delegate specific permissions and information according to the role of the user who ...
0
votes
0answers
13 views

Title hover over image in Wordpress - Woocommerce

I have this image using mouse hover parallax effect. I need that title (El lado oscuro) and the subtitle (Está en Kame Toys) appear from the bottom (not visible) to the same place you can see right ...
-4
votes
0answers
27 views

How to hide my sidebar when cart is empty [closed]

What is the code required to hide my sidebar when the cart is empty and where would I put the code. I have tried doing some stuff in the adtiononal css thing, but without any succes.
0
votes
0answers
15 views

Woocommerce: Add a free product for a customers first item [duplicate]

So I have search here and all of Google, as well as looked for a plugin. I am trying to auto add a product at a 100% discounts for customers that purchase their first product for a certain category. ...
0
votes
1answer
24 views

Woocommerce Shop category image construction

When I open url mydomain.com/shop I can see active category's rows. I want to create same view but I can't find how woocommerce construct this HTML code: <img src="https://www.example.com/...
1
vote
2answers
20 views

Get WooCommerce Product Attribute label name

Variable/variations in woocommerce products. I can do this to get the attribute value from pa_size: <?php echo $product_variation->get_attributes()['pa_size']; ?> which is somewhere in /wp-...
1
vote
1answer
14 views

How to set minimum order amount for WooCommerce excluding shipping?

Is there a code to set minimum order amount for WooCommerce excluding shipping? With this one I can set minimum order amount but with shipping: /** * Set a minimum order amount for checkout */ ...
0
votes
0answers
21 views

Remove price range variation and move to top on Woocommerce product page

Based on "Replace the Variable Price range by the chosen variation price in WooCommerce 3" answer code, I am using the following code to remove variation price range on product pages and categories. ...
1
vote
0answers
13 views

Hide shipping methods if the WooCommerce cart contains a combination of product categories

I'm trying to disable shipping method (and allow only local pickup) if: Cart only contains items from a specific category. Cart only contains items from a specific category combination. I can ...
0
votes
0answers
10 views

WooCommerce account side package rates null

I have been trying to alter shipping rates to a flat fee for a language. This seems fine by simply adding a hook to the woocommerce_package_rates. However I am now getting multiple fatal errors when ...
0
votes
0answers
6 views

Hide/Show gateways based on backorder status

I tried to adapt the code from Show hide payment gateways based on backordered items in Woocommerce so that I could hide Paypal Checkout on backordered items (show Paypal Standard) and hide Paypal ...
1
vote
1answer
16 views

Hide specific woocommerce child category

I'm using this snipet to hide child categories on Woocommerce parent category page. function exclude_product_cat_children($wp_query) { if ( isset ( $wp_query->query_vars['product_cat'] ) &&...
0
votes
0answers
9 views

Woocommerce - send emails to recipients added in acf options

I have acf repeater with initials of merchant and his email. When someone use the coupon with his initials, ie. JK-eiyte, this person should receive an email. So I check if initials equals the first ...
0
votes
0answers
10 views

How to show the products using a meta:query with WC_Shortcodes::products on WooCommerce

I am working on a WooCommerce website and I'm trying to make a query to get the 4 last products created and showing it with a shortcode. This completely works. However, I want now to show the only ...
1
vote
3answers
30 views

How to delete a coupon using api and coupon code in WooCommerce

In WooCommerce, I created a coupon like this. $coupon_data = [ 'code' => $code, 'amount' => '15', ]; $wooCommerceMRLiveV2 = WooCommerceConnection::wooCommerceMRLiveV2(); $retval2 = $...
1
vote
1answer
27 views

Prevent admin from making orders for out of stock products in Woocommerce

I don't want any out of stock products to be added in admin order page! Refer to this topic Prevent woocommerce to create manual order from out of stock products Any tricks or custom code provide ...
0
votes
0answers
29 views

Add automathically multiple files in a downloadable product

i saw this post talking about to add automathically file in a downloadable product with image of product and works perfectly. Add programmatically a downloadable file to Woocommerce products And now ...
0
votes
0answers
19 views

Why mobile navigation not work only in one page? [closed]

I've a strange strange problem and i do not understand why happen so... Simple Woocommerce website, Astra theme and Elementor. But only in a account page, the hamburger don't work. Only there. I ...
2
votes
1answer
24 views

Flatsome for Woocommerce: Annul file within INC folder

I am trying to modify a part of code inside: themes / flatsome / inc / shortcodes / ux_products.php I want to change this: <a href="<?php echo get_the_permalink(); ?>"> For this <a ...
0
votes
0answers
9 views

wordpress gallery problem with try load from http://example.com

As soon as I try to select an image for this product it tries to display the images from the domain example.com And does not preview images But as soon as I select a photo, it appears as usual from ...
-4
votes
0answers
18 views

Uncaught TypeError: t.addClass(…).block is not a function [closed]

What causes this error in Wordpress. cart.min.js:1 Uncaught TypeError: t.addClass(...).block is not a function at a (cart.min.js:1) at Object.quantity_update (cart.min.js:1) at Object.cart_submit (...
0
votes
0answers
20 views

WooCommerce Restrict Cart Items by Product Categories

I am adding code to restrict the cart from adding an exclusive category of products with other products (with the exception of another category) but for some reason my code only works once-twice and ...
0
votes
0answers
17 views

WordPress append query string to all permalinks urls once a user is logged in to force browser cache refresh

The site is designed in WordPress with WooCommerce and is a wholesale site,so all the products add to cart is disabled until the user is logs in. But due to caching of browser, even after the user is ...
0
votes
1answer
31 views

Hide/remove 'add to cart' button on shop page for one product only

Is there a way to hide or remove the ADD TO CART button on the shop page for a single product only? This would be in order to force the user to click to the single product page, where they are to "...
0
votes
0answers
24 views

How to display the best selling products in the last 4 weeks in Woocomerce?

I trying to avoid using joins and such so was wondering if it's possible to do this with wp_query. The below code gives me the most sold products in general. How can I modify this to retrieve the ...
0
votes
1answer
23 views

Custom product loop excluding values with same name

I need to hide products with same title from WooCommerce shop page so i created a loop which is working and does hide products with same name but i have a problem. If i set posts_per_page=8 it shows ...
0
votes
0answers
11 views

Wordpress WooCommerce - Get Attributes Options Names

I am using WooCommerce on Wordpress, my question is how do I get the attributes option names? I have this code here: $attributes = $product->get_attributes(); foreach ( $attributes as $attribute ):...
0
votes
0answers
7 views

Woocommerce: Display text after order total only for NOT virtual products

I'm using this code to display a small text after total section in Woocommerce cart: add_action( 'woocommerce_proceed_to_checkout', 'custom_cart_totals_after_order_total' ); function ...
0
votes
0answers
8 views

Custom Woocommerce Email Template Per Category

I've made a copy of Email template file into my theme's folder: mytheme/woocommerce/emails/customer-completed-order.php Then, I changed this file to: <?php if ( ! defined( 'ABSPATH' ) ) { ...
0
votes
0answers
4 views

Woocommerce adding and updating custom field of woocommerce in Wordpress

Can you help me to find a solution on how to display the result of this get_post_meta? add_action('woocoomerce_single_product_summary',function ($product_id){ $post_meta_value = get_post_meta(418,...
1
vote
2answers
29 views

Redirect Custom Page If the Product Count is Zero in a Woocommerce Category

I Need to Redirect a Custom Page If the Product Count is Zero in a Woocommerce Category Kindly Help me
0
votes
1answer
18 views

split cart items when quantity is updated on cart page

I want to split cart items of same product in individual lines. When I increase quantity on single product page and add to cart, it shows as separate cart items. I have used following code: ...
0
votes
1answer
8 views

Woocommerce Product details page remove add to cart and put Email Button

In my woocommerce website for simple products, I need to remove Add to Cart, quantity box and put a Email Button with mail to link. Can anyone please help me how can i do it.
0
votes
0answers
6 views

Woocommerce storefront responsive issues

I am building an ecommerce site with Wordpress and woocommerce. My theme is Storefront and I am using a child theme. I am having some issues with how the categories and products are shown depending if ...
0
votes
1answer
20 views

How can I display products of a specific subcategory?

I want to display the list of products of a specific sub-category of a category. My code is as following: <?php $args = array( 'post_type' => 'product', 'posts_per_page' => 1, 'product_cat' =...
1
vote
0answers
18 views

Display variation array in woocommerce cart and checkout page

Am trying add some custom data to my cart. For that I have used $woocommerce->cart->add_to_cart($domainProductId, $period, 0, array('Domain Name' => $domain, 'Domain Term' => $period))...
1
vote
1answer
32 views

WordPress get_query_var( 'view-order' ) returns an empty result [closed]

I have a problem. I've created a new class. I require this class in my functions.php and then I create a new object from the class new Test();. So far so good. In my constructor I then have the ...
0
votes
0answers
13 views

How can we show product with their category heading on archive page but excluding parent in Woocommerce?

I have category pattern like as: Parent child 1 child 2 When I click on parent for archive page, is there any way to show all child products with their category separately, but excluding parent. I ...
0
votes
2answers
35 views

how to load test wordpress site?

How I can test the performance of my site. I need to check either more than 400 users can access the site at a same time and purchase one product. Need to test one special product to be sold. Which ...
0
votes
0answers
17 views

How to set the add to cart button to get the price from a form field?

I am currently working on a ecommerce site. The word press theme I'm using is Astra. I have a form which calculate the prices for certain products. I want the add to cart button to get the final price ...
0
votes
0answers
17 views

Create Woocommerce products from external cURL [closed]

I am currently trying to import product data from another CMS into woocommerce to create WooCommerce products. They do allow for API integration but in order for me to retrieve any product data, I ...
-1
votes
0answers
13 views

Credit card info removed after coupon code is applied

On the checkout page of a woo commerce site when I put my credit card information first and then I try to apply my coupon code my credit card information is removed and I have to put it in again. My ...