Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [woocommerce]

OFF TOPIC. Questions *specific* for this e-commerce plugin have their own forum at https://wordpress.org/support/plugin/woocommerce.

1
vote
0answers
8 views

Which naming convention is latest in WooCommerce?

I'm creating a Woocommerce theme and the classname naming in WooCommerce make me confused. for example: <div class="woocommerce-message woocommerce-message--info woocommerce-Message woocommerce-...
0
votes
2answers
1k views

Getting the gallery images from products in woocommerce?

Looking for a code which could potentially help me get the list of gallery images present in product in woocommerce. Need them so i can use them in a custom single page design for woocommerce product ...
0
votes
0answers
16 views

How can I import and export woocommerce products with image? (Not image link, proper image)

I want to export and import products with images, if i import a product from CSV, and I put the image in CSV file. So after upload, wordpress/woocommerce make the image as featured image. Please help ...
0
votes
1answer
1k views

Woocommerce Product Attribute Permalink doesn't work?

Normally, I can filter product by attribute via calling "mysite.com/shop/?filter_brand=tesla" However, when I tried to call it as "mysite.com/brand/tesla" but it doesn't work and show 404 not found. ...
2
votes
1answer
18 views

Wordpress codex: apply_filters - clarification on creating a new hook on the fly. How do we use it?

I have read the WordPress Codex on add_filter and apply_filter countless times, but it wasn't until reading woocommerce source code today that something clicked in the way that maybe I don't ...
0
votes
0answers
13 views

How to add a special Woocommerce “Buy Now” button?

I wish to add a "Buy now" button on product page, and redirect to checkout page after clicking it but without adding the product into the cart. For example, if there are already products 1 and 2 in ...
0
votes
2answers
933 views

Functions.php change for Woocommerce not working

I am trying to add this to functions.php. In my test lab on a different site it adds the test info information fine. But on the website I am trying to add it to nothing happens. The website is running ...
0
votes
0answers
9 views

Print Gift messages from within WordPress/WooCommerce

I have an option to add a gift message (using product add ons plugin) on the product page. When I am processing my orders I then have to copy and paste each gift message one by one into a Microsoft ...
0
votes
0answers
9 views

Display Woocommerce review stars without any reviews

I wrote this code to display empty Woocommerce review stars if there are no reviews on the single product page. Currently, Woocommerce doesnt display any review stars is there are no reviews for a ...
0
votes
0answers
15 views

Remove custom role when subscription expires

I have two different types of subscriptions (basic and plus) and have a different role assigned depending on which subscription is purchased (3rd party plugin). So when the basic is purchased, they're ...
0
votes
0answers
3 views

How to link to page with matching posts/products

I feel like I must be really stupid because I've spent so many hours trying to work this out and have got nowhere. I've been working on a plugin which mainly uses AJAX and WooCommerce REST API to ...
1
vote
1answer
1k views

creating product with variations using woocommerce REST API

I've created a product with variations but they are not linked at the back end and won't show up on the product page unless i manually set them $data = [ 'title'=> 'ship your idea5', 'type' => ...
0
votes
1answer
15 views

Duplicate shipping method logic to another shipping method

I have a plugin that adds additional shipping method with some intricate logic to it that adds specific checkout fields with API-generated values etc. The thing is that I need variation of this ...
0
votes
0answers
8 views

Woocommerce change send another email if order total is 0

I want to create a custom email if order total is equal to 0.0. How do I check this condition and prevent to send the default email? I was trying to play around with ...
4
votes
4answers
6k views

Get all products with a custom attribute

I want do a custom query to get all products with an especific attribute ("demo" in my case) The query what i want returns from this: a:5:{s:4:"demo"; a:6:{s:4:"name"; s:4:"DEMO"; s:5:"value";...
0
votes
0answers
19 views

woocommerce wc_get_product is not fetching all the product of particular category

I have created dummy product data with fakerpress and many products were created with "future" status, so I updated the post status to "publish". I wanted to retrieve all the product of selected ...
0
votes
0answers
31 views

Woocommerce html emails are just broken - it automatically adds many “=” characters spread randomly within the code

after many hours of trying to fix this mysterious issue I decided to reach out for help. Thanks to everyone willing to aid me. When I send HTML emails from Woocommerce, those emails are received ...
0
votes
0answers
13 views

Add to total price if product is in a specific category

I have 3 categories on my site (small-cars, cars, truck) and each category has a different formula for "extra miles": small cars (1 * field) (2 * field), trucks (2.5 * field). Like the calculation ...
0
votes
1answer
17 views

Add custom attribute to product's HTML to woocommerce cart page

I'm trying to add a data-attribute to WooCommerce's cart page. The cart page populates a table with each row being a product that has been added to the cart. I'm able to add a data attribute into ...
1
vote
1answer
751 views

How can I allow access to two user accounts using one login?

I have spent the last two hours searching for this and I cannot find a solution to my problem. I have a WP site with WooCommerce running which allows to users to create their own store. My client ...
0
votes
0answers
14 views

Product permalink not updating

I want to select default product permalink but not update. After update the setting the product permalink save as custom base. Any one can help me Please...
0
votes
0answers
22 views

Deep level variables woocommerce on add to cart page

Please advise a way or a plugin or a method to assist with building the structure below. I would like an attribute nested within another attribute nested within another attribute for a specific ...
0
votes
0answers
16 views

Remove product category placeholder image (Woocomerce)

I'm trying to get rid of placeholder product category images on the shop page. Right now I'm using this code to add a .no-image class to products that don't have an image so I can style them ...
1
vote
1answer
908 views

WooCommerce - Multiple meta query not working

Any help on why this multiple meta query is not working is greatly appreciated, both meta_query arguments have been tested independently. I'm looking for bringing Featured products as well as Best ...
0
votes
0answers
13 views

update ACF user metas programmatically [on hold]

I use woocommerce where I have a custom hidden field on checkout page which is populated by a survey. Each user has some user metas created over ACF and I would like to add this hidden data to ACF. ...
0
votes
0answers
16 views

Change WooCommerce template for PDF - access to custom field

I want to do some modifications to a template of WooCommerce, but I'm rather ZERO in PHP, so that is why I'm asking some guidance so I could perform my small modifications, which I'm sure are not too ...
0
votes
1answer
2k views

Adding custom cart price with Ajax in wordpress

I'm trying to add a custom price to the cart using the following function (in functions.php): //Change cart item price function add_custom_price_callback( $cart_object ) { $custom_price = intval($...
0
votes
0answers
10 views

How to add a inbuild block using a code? [on hold]

How I can add an inbuilt block using the code directly to the Dashboard??? Is there any function?? or code which add a block, for example, shortcode block.
0
votes
0answers
10 views

Product adding to cart without variation being selected first

We have the woo side cart added, when a customer clicks on an item it automatically adds to the cart even before they select the size or colour, how can we stop it from doing this. It will even add ...
0
votes
0answers
18 views

Error on Wordpress site: “an error occurred while processing this directive”. Have debug.log output available

Hope someone might be able to shed some light on this one. The error is very generic and seems quite unpredictable. Happens on some page loads, not others, and when it does, if you refresh a few times,...
0
votes
1answer
801 views

Woocommerce product download URL

I'm making a skin for The Grid plugin (https://theme-one.com/docs/the-grid/#developer_guide). All the products are virtual and downloadable — I've managed to make an add to cart function, but need to ...
0
votes
0answers
9 views

Is it possible to have multiple product_tag in a WordPress URL?

I'm trying to create a custom link that combines two product-tags for filtering products that have the product-tag man AND brandname. I'd like to put in the same link the following two example links: ...
0
votes
0answers
7 views

connect woocommerce custom field to wp user meta upon customer registration

I'm adding a custom field on my woocommerce registration that actually saves customer IG usernames by using this code below placed on my child theme's function.php file: function ...
0
votes
0answers
25 views

woocommerce axios react

I don't understand why my request to WooCommerce API doesn't work. My usage on react App via axios: First try: return axios.get( 'http://domain/wp-json/wc/v3/products?featured=true', { ...
0
votes
1answer
13 views

How to show Custom Field Value in Woocommerce Shop Page

remove_action('woocommerce_shop_loop_item_title','woocommerce_template_loop_product_title',10); add_action('woocommerce_shop_loop_item_title','fun',10); function fun() { echo 'custom_field_value'; } ...
0
votes
0answers
5 views

Order selector when using woocommerce products shortcode [closed]

If I display products with shortcode like this: [products category="edesitok" pagination="true" limit="12" columns="3"] there is no sort order selector on the top of the list (for visitors) like "...
1
vote
1answer
41 views

Getting categories id for all products in cart

What I'm trying to do is to take the categories for products which are in the cart. Then check via some conditions what category id is and show different notice. So far I have this /** * Cart ...
0
votes
0answers
15 views

Help to arrange attribute product in right order in woocommerce

I have a WooCommerce website where I want to sell shoes, but I have a strange problem. The attributes are set randomly and don't fit the order set in attribute custom order. I have this function which ...
0
votes
1answer
491 views

How can i create a WooCommerce product programatically or using sql query?

I want to add a product to a cart problematically without using the admin panel. Add to cart and then checkout using php code. So how can i achieve it and where do I place the code? I am writing a ...
0
votes
0answers
16 views

How to limit which information about a product is returned by wc_get_products (WooCommerce)?

My current code uses wc_get_products to return all published products that are instock: $wc_products = wc_get_products(array( 'status' => 'publish', 'stock_status' =...
0
votes
0answers
13 views

Add extra products on add-to-cart action

I'm having some trouble adding extra products on add to cart button is executed. Basically, the user gets a few extra products in the product to choose from, My problem is that the user can still ...
0
votes
0answers
12 views

Comment review not mandatory

I have a star rating system in my web, and I need comments to not be mandatory so that customers can review only using the stars. How can I do that? Thanks!
0
votes
0answers
40 views

How to customize buttons on single page product

I am trying to add a second button called "pay online" on a single product page with the Custom Fields Plugin, but I am getting this error/output: ?> You can also see the problem following this ...
1
vote
1answer
923 views

WooCommerce add_to_cart url not working

I created a custom button to add products to cart and I'm using this link: http://signaturecarbone.s23528.liner7.atester.fr/panier?add_to_cart=91&product_id=91&variation_id=93&...
0
votes
1answer
26 views

Shop Manager role cannot edit pages using WPBakery Page Builder [on hold]

I'm using both WPBakery Page Builder version 5.4.7 and Woocommerce version 3.5.1 on a site I'm working on. Even with the settings enabled for the Shop Manager role to access and use the Visual ...
0
votes
1answer
1k views

Create a Woocommerce product widget with category filter

I'd like to create a WooCommerce products widget like the standard WooCommerce products widget, but with the option to filter on category. I know there is a shortcode for displaying products of a ...
0
votes
0answers
7 views

WooCommerce: How can I select the catalog_visibility for a product?

I know, as simple as it sounds but I don't get it running: How can I select the product visibility for a product by his id via SQL? This is what I have: global $wpdb; $result = $wpdb->get_col( "...
0
votes
1answer
753 views

Woocommerce pagination not working in custom loop WP_Query

Please help with pagination I have code that works fine (functions.php) function projects_custom_number_of_posts( $query ) { $query->set( 'posts_per_page', 2 ); return; } add_action( '...
1
vote
1answer
11 views

Automatically Update Woocommerce Prices

I am running on WordPress v4.9.8 using WooCommerce v3.4.2. Recently I've made an Excel spreadsheet which collects competitor's prices for multiple products via query. My target is to follow these ...
0
votes
0answers
9 views

Sometimes I am still getting 404 error if I call add_rewrite_endpoint & flush_rewrite_rules on activation / deactivation hook

I need to add a custom tab to my woocommerce my account page, so I followed this article: https://github.com/woocommerce/woocommerce/wiki/Customising-account-page-tabs#creating-new-endpoints /** * ...