Sometimes, especially if you are using custom plugins to import stock data, you may find products with some stock value (greater then 0) but with stock flag set to “out of stock”. How to find them? Using WP_Query of course:

Notice ‘post_type’ => ‘product_variation’ – if you are not using variations, just change it to ‘product’.

This can be really frustrating, you wanted your woocommerce shop running multilingual, but from cart page “Checkout” button leads to default language version? Solution is very simple, but not elegant – so far did not found another solution. First step is to create all woocommerce pages in every language you need, this is very simple but can take some time. Then, in your child theme (remember not to make any modifications to theme you are using!), in functions.php add such code:

All those functions are using same pll_get_post from Polylang plugin, to translate your default page ID you set in Woocommerce/Settings/Checkout/Checkout Pages to their translated version. Hope you will find it useful.

Well, the easiest way is to use

but if you don’t want to update all bundles and waste an hour of your time, you can use:

where <app> is placeholder for you app dir, like “app/frontend” or “app/backend”
in case you don’t have build_bootstrap.php on path above (it works for Symfony 2.7.x) just search for it inside vendor\sensio\distribution-bundle\Sensio\Bundle\DistributionBundle

Since this information is not easy to find, I want to share it with you. Valid WSSE security header should look like this:

this way you can execute request requiring this header.

This can be frustrating when you are new to wordpres and/or woocommerce. You just created your first product, and got 404 when trying to see it. Fortunately solution is quite simple. In backend panel go to “Settings”, then “Permalinks”. In “Common settings” section make sure “Post Name” is selected, if not, choose it – it will look like “”. Then look below, in “Product permalink base” section choose “Shop base” – it will look like “”. Click “Save CHanges” and below you should see new box with .htaccess settings like:

Just copy it and paste to your .htaccess. All links should work now!

I found few solutions, but obviously none of them were working, so had to find it out by myself. So where to start – lets suppose we have our $post_id somewhere (I’m pretty sure there are lot of tutorials how to get post from database), so in first step we need to modify some base product settings:

So what happens here? In first line we are changing our product type to variants (you can do it also in product edit page in woocommerce), next line adds all possible colors we need (this can be any attribute like size, model or everything you want), $availableColors is just plain php array. Next step is:

Code above adds our color attribute to base product also with all possible values. Which is important here – is_visible should be set to 0 and is_variation should be set to 1. Then:

The last part is to insert or update your variation for each defined color. The variable $post_name can be anything you want, just should be same schema for all variants as we are using it to check if such variant already exists and should be only updated, or not exists and should be created. But you can use also SKU or GUID for this.

Maybe someone will find it usefull:


It is a bit different then method showed in previous post – this time its not transactional email sent at demand, but we will catch event fired after invoice is generated. So (I suppose you have your module already) in etc/config.xml add:

Then create your class at app/code/local/YourVendor/YourModule/Model/Observer.php (or use existing one) and add new method:

And invoice will be attached to email defined at:

Zrzut ekranu 2015-01-14 o 19.12.17

Seems to be complex, but its not that bad:

About $vars variable – in this one you can put everything which is set inside email template as variables.

If you are using MAMP and trying to execute doctrine:schema:create or anything db related you may encounter that error, solution is simple – you need to create symlink to mysql.sock: