Playing around with a Google Base export for Virtuemart.
I have set most of it up and just checking/testing a few bits.
When exporting product_in_stock for the g:availability field, this is putting the actual stock number in place, which I guess is exactly what I am asking CSVi to do, but Google being Google, they don't like that, they want to see a value "in stock" or "out of stock".
Do you have any ideas how I can get CSVi to put these values in place instead of a number.
So if more than zero add "in stock" if zero or less add "out of stock"
Thanks in advance,
Andy
Nil Satis Nisi Optimum !
Hello Andy,
You can use the Rules to add a replacement during export for this field. You can have one rule that matches 0 to show "out of stock". You can have another rule that matches 1,2,3,4,5,6,7,8,9 using multiple values and have it show "in stock". There is no rules plugin that can do a greater than or lower than and equal check. Might be a nice idea to add.
Finally if you are really adventurous you could write your own Rules plugin and have it do exactly what you want.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Thanks for your reply. I pretty much have all the google base export sorted out now, but this availability/stock is an issue.
Having the stock/availability is a compulsory field for the Google feed & must have one of the values;
[ol]
[li]preorder[/li]
[li]out of stock[/li]
[li]in stock[/li]
[/ol]
Iv'e set up a rule to replace the "0" with "out of stock" , but without a way to change all other numbers to "in stock" , I am not sure what to do.
Adding all numbers 1 through 9999 isn't really an option & I wouldn't know where to start with creating a rules plugin of my own.
And although I personally don't need the "preorder" I am not sure how that could be handled either?
Nil Satis Nisi Optimum !
OK, bit of digging with regular expression and this is sorted of in/out of stock. Not sure how you would solve the "preorder" secenario.
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
Thanks for pointing me in the right direction
Nil Satis Nisi Optimum !
Hey Andy,
Thanks for the feedback. That is a good solution.
Adding all numbers 1 through 9999 isn't really an option
I didn't mean to add all the numbers, just the numbers 1 through 9. You don't need any higher numbers. For example if you have 234 in stock, matching the number 2 you know it is above zero, so it can be replaced. That is what I was thinking.
In the future we will have a rule where you can do comparison and change values :)
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Log in to reply to this topic.