on 2018 Mar 26 9:49 AM
Request clarification before answering.
You need to specify something to match on, i.e. you need at least one [unique=true] column.
Often with other types you can use itemtype(code) but this doesn't work as well for Product because you need to specify each type that extends product
UPDATE Product[batchmode=true];itemtype(code)[unique=true];myattribute
;Product;foo
;VariantProduct;foo
;MyCustomProductType;foo
With types that have a boolean attribute it becomes much simpler because there are only 2 options (assuming it's not optional)
UPDATE AbstractCMSComponent[batchmode=true];visible[unique=true];myattribute
;true;bar
;false;bar
If the attribute you are updating already contains a known value then you can use this to match on
UPDATE Product[batchmode=true];myattribute[unique=true];myattribute
;before;after # updates all 'myattribute' that are 'before'
;;after # updates all 'myattribute' that are blank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.