VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: chill_e_g on August 05, 2016, 12:45:45 PM

Title: Bulk change "apply No Rule" to "apply generic rule"
Post by: chill_e_g on August 05, 2016, 12:45:45 PM
Hi Guys

For some reason I have a lot of product with "appy no rule" set. This is obviously not the default and I have to change each one manually to "apply generic rules" for discounts to be applied. This happend in a csv import. Virtuemart 3.0.7.4

Is it possible to bulk change to default setting "apply generic rules"?  Hope so, manually is pain in the arse!
Title: Re: Bulk change "apply No Rule" to "apply generic rule"
Post by: GJC Web Design on August 05, 2016, 16:45:02 PM
UPDATE `#__virtuemart_product_prices` SET `product_tax_id`= 0 WHERE `product_tax_id` = '-1'
Title: Re: Bulk change "apply No Rule" to "apply generic rule"
Post by: chill_e_g on August 08, 2016, 09:28:33 AM
Thanks, but nothing happened, I assume this is a sql query that I must submit, I tried with the # and replacing it with the db prefix.
Title: Re: Bulk change "apply No Rule" to "apply generic rule"
Post by: GJC Web Design on August 08, 2016, 10:02:17 AM
works here.. it is correct

UPDATE `YOURPREFIX_virtuemart_product_prices` SET `product_tax_id`= 0 WHERE `product_tax_id` = '-1'

something must happen .. at a minimum an error message
Title: Re: Bulk change "apply No Rule" to "apply generic rule"
Post by: chill_e_g on August 08, 2016, 10:57:15 AM
Here is my sql reply:
0 rows affected. (Query took 0.1880 seconds.)
Am I doing something wrong?

There are 2 dropdowns in the product, first 1 applies tax and 2nd for discounts, its the second one that needs the bulk change to "apply generic Rules"
Title: Re: Bulk change "apply No Rule" to "apply generic rule"
Post by: GJC Web Design on August 08, 2016, 11:08:30 AM
adjust this ->  WHERE `product_tax_id` = '-1' to what ever u want changed
Title: Re: Bulk change "apply No Rule" to "apply generic rule"
Post by: chill_e_g on August 08, 2016, 11:16:00 AM
Thanks, but you are assuming I know what to do

If product_tax_id is the first dropdown, what is the name of the second one for discounts?
Title: Re: Bulk change "apply No Rule" to "apply generic rule"
Post by: GJC Web Design on August 08, 2016, 15:48:37 PM
look in the table.. if mine is set on apply no rule the value is -1

you have a product_tax_id which u want to change to 0
Title: Re: Bulk change "apply No Rule" to "apply generic rule"
Post by: chill_e_g on August 08, 2016, 20:27:06 PM
Nope, sorry, but I think you are incorrect. I dont want to apply tax rules, below that, I want to apply generic rules, see screen shot attached
Title: Re: Bulk change "apply No Rule" to "apply generic rule"
Post by: GJC Web Design on August 08, 2016, 21:44:05 PM
Yes! genetic is 0 .. that is what the query does..

Check directly in your table
Title: Re: Bulk change "apply No Rule" to "apply generic rule"
Post by: Milbo on August 09, 2016, 23:01:31 PM
Quote from: GJC Web Design on August 08, 2016, 21:44:05 PM
Yes! genetic is 0 .. that is what the query does..
right!