1. davidex21
  2. RO CSVI
  3. Friday, 22 January 2016
  4.  Subscribe via email
Hello. I want to know if through rules (for google base), I can create a rule example: if: product_in_stock = 0; out of stock, if: product_in_stock >= 1; in stock.

Thank you
Accepted Answer Pending Moderation
Hello,

You can create these rules. The 0 is easy, as you just need to check if the value is equal to 0 then replace it with "Out of stock". Then you need another rule to check if the value is 1 - 9 and replace it with "In stock". Finally the last one is harder, as you will need to use a regular expression to see if the value contains 2 or more numbers. So you will need to read up on using regular expressions.

You could also make a rule to replace multiple values and you add all the numbers there.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
you give me an example?
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
you give me an example?
I gave it to you in my previous post.

You can read all about replacements in the documentation. It has screenshots as well.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
I can create a rule example: if: product_in_stock = 0; out of stock, if: product_in_stock >= 1; in stock.

Hi David,
I'm in the exact same boat as you. I had initially asked if you had solved this, but this is an edit as I have now solved it & sharing here for you & others.

I set up these below rules & added them to the stock/availability field in the google base export template that I have set up

1st I set up a rule for out of stock.
Find: /^0/
Replace: out of stock
Set as regular expression

2nd I Set up a rule for In stock assuming stock is not greater than 99999
Find: /^(?=.*[1-9].*)[0-9]{1,5}$/
Replace: in stock
Set as regular expression

ScreenShot2016-03-17at22.43.13.png

ScreenShot2016-03-17at22.43.22.png
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!