We are currently unable to provide proper support!

We are very sorry to announce that we are currently very busy working on some huge, very time-consuming and time-sensitive projects, so currently we are unable to provide proper support in our forums! We hope that after the conclusion by the end of July we will be able to properly answer all open support requests.

Sorry for the inconvenience and thank you for your understanding!

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Custom variables not working properly

Custom variables not working properly 29 Apr 2016 10:41 #1


I'm trying to use custom variables on product categories. I have tried to use
for variables and using equal and contains condition and non of them work.
What i want to achieve:
If category = AAA then prefix = AAA
I have [prefix]-[year]-[#####] as an output.

But instead of getting let's say AAA-2016-00001 i get [prefix]-2016-00001 as an invoice and order numbers.
I have disabled all plugins and moved to default theme, but it did not help.

How to use categories as a custom variable. I have tested demo and it did the job. But once i've purchases it does not work on my site.

Please Log in or Create an account to join the conversation.

Custom variables not working properly 03 May 2016 11:33 #2

Ok. Seems i have found a bug in your plugin
1) custom variables does not work if name (tag or category) consists of multiple words like training materials. It does not work neither with equal sign nor with contain option. Once i change slug to one word (let's say training) it works ok but then second error comes.... below
2) custom variables does not work if = sign is used, even if work is written completely. It works only when i pur contains. So Categories = training will not work, but Categories contains training will work.

Please Log in or Create an account to join the conversation.

Custom variables not working properly 03 May 2016 23:10 #3

Dear Iai,
Thank you for investigating further.

The categories (and tags) variables are a list of all category/tag SLUGs, not the human-readable names, as the names might be translated in multilingual shops. Typically, if you have a category with display name "Training Materials", the Slug in the category definitions page is "training-materials". If you use that in the custom variable definitions, things should work.

I have updated the documentation page to indicate that the Categories list contains the SLUGs of the categories, not their human-readable names.

Regarding the check with an equal sign: Categories is a LIST, so = does not really make sense in general. For list variables like SKUs, Categories, Tags, ShippingClasses etc. you should always use "contains".
The only case where = makes sense if there is only one category in the cart (i.e. all products belong only to one and the same category, and no other categories => the categories list is a list with one entry). In this case, category="training-materials" might be understood as a condition: There are only products from that one category in the cart, and none of the products in the cart belong to any other category (i.e. the Categories list is a one-element list with sole entry "training-materials"). For now, I think this is too much of a borderline-case, so we'll probably not implement this idea. Using "contains" on those five list variables provides exactly the functionality that you want to use, so I don't see any pressing need to change this.

Sorry for the confusion with the contents of the Categories list!

Best regards,

Please Log in or Create an account to join the conversation.

  • Page:
  • 1

VM - Shopping cart


Cart empty

Login Formular