hello together,
im trying to add a views-bulk-operation to the commerce product list, which alters the [product:commerce-price:data] field to include or exclude VAT on demand.
so far i created a component in rules which sets the field price:data to a new value and shows it within the view.
in my configuration the field config with tax is:
a:2:{s:10:"components";a:0:{}s:11:"include_tax";s:4:"mswt";}
and without tax:
a:1:{s:10:"components";a:0:{}}
now the problem is to get the values into the field without having the need to know the ids of taxes and components.
any insights would be helpful
greetings fooby
ps: sorry for my bad english :)
Comments
Comment #1
rfayI *think* this is about price, so changing component.
For what you want to do, we just need the Commerce API that's needed to do it. I think the way to sort this out is to see what Commerce does when you click that checkbox.
Comment #2
fooby commentedi added a screenshot of my rules component.
the problem is that i cant choose one of the parameters and some exceptions are thrown
isnt list of text the data type i need?
Comment #3
rszrama commentedThere won't be any way to do this purely through Rules, because you cannot manipulate the contents of the data array just by using basic Rules functions (unless you're using a PHP action). This will require some sort of custom action where you can in fact choose from a list of available VATs, because the Tax module needs to know the name of the tax to include when it loads a product price. No way around that.
Comment #4
rfayCalling it fixed then...
Comment #6
czperry commenteddid you ever solve this one fooby? if you solved with php can you share the code snippet. thanks
Comment #6.0
czperry commentedremoved code tags
Comment #7
darrenwh commentedI've found this to work: