It is possible to bulk create products on WooCommerce? I am using the wp-cli Product command but it seems that I have to create one by one. This takes a lot of time since it is going to make a query for each product, even worse, it is going to be a cron job that will be run regularly. I
Tag: woocommerce
Force WooCommerce to update fragment
I created plugin which uses WooCommerce fragments for showing to user how many points they have. When user uses some of the points (by adding product into cart) everything works ok. But when admin adds points to user by admin-interface, the fragment is not updated until user adds a new product into cart. Here is code sample: Is there any
How to display WordPress WooCommerce custom attribute in templates/functions?
Would put this in WP Stack Exchange, but often they say since it has PHP it should be in SO, so never quite sure where is best. Can move if more appropriate. To display a custom woocommerce product attribute called, “Fabrics” for example I’ve read you could do the following. However, is there a shorter way since we would be
Can not get the product details from order_id on the new order hook function
With WooCommerce, I have the following hook in my function.php after the new order is submitted: The above code is not giving me any output i’e it is not entering inside the foreach loop that’s why var_dump() not giving me any output, but if I mention the order_id specifically like create_job_openings($order_id=517) it works, even I tried echo $order_id before foreach
WooCommerce Retina Image Support – Not included in srcset
I’ve recently installed WP Retina 2x, and it generates the @2x images on my server. However, when using the PictureFill or WordPress Responsive methods, the srcset does not include any @2x images or 2x declarations: I should also mention that my media is stored on Amazon S3 using the S3 Offload Lite plugin. While the generated @2x images are getting
WooCommerce Check stock of product ID before adding
I have some custom code in my WooCommerce site that adds a product to the users cart. I already have it check the cart contents to make sure there is another product in the cart first, but I also …
Counting cart-items of specific product category
I am trying to get the number of items in the cart just from a specific product category in WooCommerce. I am doing a site for a winery. It has alcoholic and non-alcoholic products. All the wine falls under the main category of ‘wine’ or category id 34, with many subcategories and products underneath them. For any thing that falls
Add an icon to custom WooCommerce payment gateway
I would like to add a custom icon to my payment gateway. I have read the WOO gateway API and have zero help. This is my code below. please help me find a functional way to include the icon so I have …
Woocommerce – Getting the order item price and quantity.
Using Woocommerce 2.6.8 , I can’t get the Order Item Data information as described in the docs and here on SO. All I want is to get the Line Item price and Quantity, which should be as simple as: Looking closer at what gets returned returned This is all using documented Woocommerce methods, why is the information I need stored
How do I stop WordPress from redirecting certain links automatically on homepage?
I want to display filtered results on the homepage of a WooCommerce shop by editing the URL. I have a filtering option by tag, category and price range. The URL for filtering by tag would look like this: And that redirects automatically to Which I don’t want because I want to add other filtering options, for example, like this: If