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

learn more… | top users | synonyms

2
votes
1answer
3k views

WooCommerce is slow with many categories [closed]

I'm struggling a bit with WooCommerce (and WordPress) being a bit slow. I have a development store for a customer with the following stats 5,319 Products 2,437 Product Categories Categories are ...
2
votes
0answers
9k views

How to get Woocommerce Variation ID? [closed]

I am trying to create some additional functionality on my Woocommerce backend where I add a custom field to the variations section of backend of Woocommerce. However I cannot for the life of me ...
2
votes
2answers
1k views

WooCommerce - Show orders for a specific product ? [closed]

How to view orders for a specific product in WooCommerce using sku or product name? What I have so far is that, but it does not work.. Does anyone know how to do? <?php $args = array( '...
1
vote
2answers
540 views

Order by rating not works in wp_query

I need to sort my products by rating in a wp_query loop: this is my code: switch($ordering){ case 'default': $meta_key = ''; $order = 'asc'; $orderby = 'menu_order title';...
1
vote
2answers
5k views

How to check if woocommerce is activated in theme

I'm creating a theme with woocommerce which has the following: <ul> <li> <?php if ( is_user_logged_in() ) { ?> <a href="<?php echo ...
1
vote
2answers
883 views

Declaring custom woocommerce product type as virtual / downloadable only [closed]

I'm trying to set up a woocommerce custom product type so that its as minimal as possible - no options I don't specifically designate. Still, despite the declaration below, the custom product meta ...
1
vote
2answers
128 views

Is WooCommerce updates for WordPress necessary? [closed]

Hi guys I have 2 notifications for WooCommerce currently! 1) - WooCommerce Data Update – We need to update your store's database to the latest version. 2) - WooCommerce plugin update to version ...
1
vote
2answers
8k views

Display featured products through custom loop in woocommerce on template page

I was wondering if someone could help me out. I would like to display 6 featured products from my woocommerce store on my home-page.php template. After some researched I found that the right way to do ...
1
vote
1answer
1k views

woocommerce - get_image_size() deprecated [closed]

Today I've updated my woocommerce plugin and get a fatal error on: $woocommerce->get_image_size( 'shop_catalog_image_width' ) I'm using it in a hook function to get the placeholder width: ...
1
vote
1answer
215 views

How to solve suspected memory issue in custom WordPress loop?

I have written a plugin that adds a "Where did you hear about us?" question to the WooCommerce checkout page and shows the results (as a simple horizontal bar chart) in a wp-admin page. The plugin ...
1
vote
1answer
2k views

How do you access the Product Short Description in a WooCommerce email template? [closed]

I would like to output the Product Short Description beneath the product name inside the order items table inside WooCommerce emails. I think I know where to place code inside the email template file, ...
1
vote
1answer
6k views

Orders being sent to wrong admin email in WooCommerce [closed]

I set up an admin User for myself to create the site, then another for my client to use. I changed the emails in WooCommerce to her address wherever I can find them, but the orders are still coming ...
1
vote
2answers
13k views

Get the product list of a given Category ID

I couldn't find the right way to get the list of all products for a given category ID (not category name). The code I am using to get the categories list is the following, it works fine: $args = ...
1
vote
3answers
3k views

Use get_term_children to get the sub category of a parent category for the current post

In my WooCommerce theme I've created a root category: 'Brands' then for each product I've added it's brand as a sub category to the 'Brands' parent category. On the product page I want to display the ...
1
vote
1answer
111 views

How to Use PHP Code In-Page?

I am looking to create a dynamic Add-to-Cart button. The problem is that I need my server to dynamically create the "add-to-cart" URL. Currently, I have a static example built here at this link. ...
1
vote
2answers
494 views

Hide a menu-item and its submenus and display a 'Log in' link if the user is logged out

I need, somehow, to enable that when you logout, that 'My Account' item is getting hidden from the navbar, and instead it displays a 'Log in' link. The item 'My Account' also have submenus with the ...
1
vote
1answer
52 views

Detect whether a page is a product subcategory page?

How can I detect whether current page is a product sub category page? I've tried with the following but it will always print out "NO" function is_subcategory($category = null) { if (is_category()...
1
vote
2answers
93 views

Unhook action from child theme

I have decided to use a WooCommerce Storefront child theme called Galleria, when I have previously used the Storefront theme I have used the common remove_action to unhook the defaults and replaced ...
1
vote
1answer
64 views

How to set a minimum length for username in Woocommerce? [closed]

I need to set a minimum lenght for username in a website that use WooCommerce. In a "standard" WordPress installation (without WooCommerce, I mean) I could use a snippet like this one: function ...
1
vote
1answer
59 views

Filter get_adjacent_post to follow woocommerce product category

How do I filter get_adjacent_post to follow the next category by the product category drag & drop screen? Is using get_categories correct? How do I join it into get_adjacent_post? $post_prev = ...
1
vote
2answers
38 views

WOO-Commerce translation | Tried it all [closed]

Hope anyone can help me with this problem. I installed WOO-Commerce all great and I set up the language to Dutch ... But as you can see there are still a lot of small things still not adjusted to ...
1
vote
1answer
217 views

Editing Header Titles of each details in woocommerce Order Email [closed]

I'm using flatsome theme, woocommerce plugin. On my thank you page I get the bank details, order details and customer details etc. but on customer order email, header TITLES of those details are ...
1
vote
1answer
113 views

Limiting woocommerce line_total decimal length

I am trying to get line_total woocommerce price, but i just cant figure out how to deal with number of decimals. It is now showing price with 4 decimals like 5.5444$ and i want it to show max 2 ...
1
vote
1answer
334 views

Can I remove WooCommerce main content hook?

<?php /** * woocommerce_before_main_content hook * * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content) * @hooked woocommerce_breadcrumb -...
1
vote
3answers
2k views

Add CSS class to add-to-cart button, Woocommerce [closed]

Im looking for a way to add a custom class to the add-to-cart button on the single-product.php page in Woocommerce. I have tried the following without any result: Copy whole woocommerce-folder from ...
1
vote
2answers
43 views

Help with some php math in Wordpress

I've made a woocommerce store and I am using a dropshipper - so every product has an price and a trade price for me - which I am importing and storing as a custom field 'trade_price' on the product. ...
1
vote
1answer
2k views

WooCommerce - Create Products Programatically [closed]

I'm writing a plugin that will automatically import products via JSON API. I need to programatically create/update products. I did a research and it seems everyone is using wp_insert_post() and ...
1
vote
1answer
719 views

Issue adding text after short description on product pages Woocommerce [closed]

I am trying to add some text after the short description on woocommerce. I have come up with the following add action but when I use it, it replaces the existing short description text. Is there a ...
1
vote
1answer
1k views

How to trigger WooCommerce order complete email?

I want to be able to trigger the WooCommerce order complete email at a different stage in the WooCommerce checkout process. So I've disabled WooCommerce order complete email from the backend and am ...
1
vote
1answer
622 views

Unable to display custom fields on WooCommerce product pages

I've set up some custom fields using the existing 'custom fields' panel on a WooCommerce product page. I'm unable to display these on the front end. My technical knowledge is limited but I've tried ...
1
vote
1answer
232 views

Exclude Empty Child Categories in Menu

I am working in WooCommerce and trying to filter out the empty sub categories. I found this code, which filters out everything "empty"...including my Home page link, About us link, etc. function ...
1
vote
2answers
833 views

WordPress Displaying Thumbnails Vertically

WordPress is displaying my thumbnails vertically and VERY LARGE. Specifically it's displaying WooCommerce product page thumbnails vertically and VERY LARGE. Can't seem to figure out why or what piece ...
1
vote
1answer
601 views

Top level parent taxonomy ID

At the top of a product archive page I am trying to display a list of product categories. The rule should be that the list always shows the direct children of the top level. There are several answers ...
1
vote
3answers
78 views

Add user data to table when user is created?

I am trying to figure out how to add user information and specific meta data to a separate table through PHP. I would prefer to do this when a user posted to the wp_users and wp_usermeta table. I am ...
1
vote
1answer
96 views

Remove duplicate product link from WooCommerce Page Row Actions

I'm desperately trying to remove the duplicate link from the WooCommerce Admin Product listing (page_row_actions). //Remove duplicate button from product list function my_duplicate_post_link($...
1
vote
1answer
25 views

Catchable fatal error on custom category post

I get this error after deleted a few of unused category's product on my woo theme: Catchable fatal error: Object of class WP_Error could not be converted to string in D:-mytheme\wordpress\wp-...
1
vote
1answer
28 views

How do I edit pre_get_post for the category the user is currently in?

I've got a Woocommerce site that uses categories and products within those categories but how do I get my search form to only display results of products within the category the user currently is in. ...
1
vote
1answer
184 views

Remove the link from the thumbnail and product title on woocommerce

Where exactly in the file structure can I find and edit the markup so that I remove that a href within the thumbnail and product title. I tried searching the template files but can't seem to find it. ...
1
vote
1answer
91 views

WooCommerce Custom Product to checkout

I was trying to create a custom shop page for a project where users can click on a product to view the details in a modal window and select some options on price variations. What I want to do is to ...
1
vote
1answer
62 views

wp_customize - detect post type to show/hide customizer options

How can I tell the customizer to only load certain customizer options based on the post type that is being previewed? i.e. using: is_woocommerce is_shop is_cart etc. When adding customizer option ...
1
vote
1answer
96 views

Cannot update WordPress General Settings Site Title and Tagline

I have a WordPress 4.4.2 installation with no SEO plugins at all. The plugins that I do have activated are WooCommerce, WooCommerce Multilingual, and WPML. I am unable to update the Site Title and ...
1
vote
1answer
309 views

Woocommerce - How to populate custom select field with stored values on checkout page?

I have converted the postcode field in checkout to a dropdown field. Its working fine. $fields['billing']['billing_postcode'] = array( 'type' => 'select', 'label' => __('Locality - ...
1
vote
1answer
54 views

Translating add to cart woocommerce button [closed]

I am trying to translate add to cart button. I have 2 code snippets from woocommerce documentation here are they: FOR SINGLE PRODUCT - THIS ONE WORKS add_filter( '...
1
vote
1answer
45 views

Woocommerce - Show random product thumbnail from specific product category

I am trying to show random product thumbnails from a specific category. I have this code at the moment but it is not working and will show from all products, how to randomize from a specific product ...
1
vote
2answers
364 views

Call global variable array() in woocommerce child/template

So I have this in my functions file - it defines the products that are not eligible for free shipping. It works everything is fine. //functions.php function my_free_shipping( $is_available ) { ...
1
vote
1answer
191 views

Taxonomy , subtaxonomy,child taxonomy of a product woocommerce

Hi i need to get the main taxonomy and sub taxonomy of a product in woocommerce . i know how to get taxonomy details .123 is product id . $terms = get_the_terms(123, 'product_cat'); I know how ...
1
vote
2answers
119 views

Following migration from DEV to LIVE, woocommerce can't checkout

I've spent all day on this and I've run out of ideas. https://www.thunderbrook.co.uk I've taken over dev of an old site that was running woocommerce with a Theme by cardinal. I wasn't comfortable ...
1
vote
1answer
1k views

get woocommerce My account page link

I am trying to send an email to customer after purchased products and when customer click on the the link provided the email for rating the product it should redirect to customer's account/My account ...
1
vote
1answer
373 views

Add product description (content) to WooCommerce customer processing order email

I'm looking for a way to add the product description (content) to the WooCommerce customer processing order email, as it contains important information to pass to the customer that they need for their ...
1
vote
1answer
314 views

Disable Sidebar in the Product Page in Storefront Theme

I am using storefront theme, where there is options for the Full Width in the pages but not in the Product Page and Product Category Page in the Store Front Theme As i played with css and i go this ...