Author Topic: Bulk change "apply No Rule" to "apply generic rule"  (Read 2946 times)

chill_e_g

  • Beginner
  • *
  • Posts: 36
Bulk change "apply No Rule" to "apply generic rule"
« 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!

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10422
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Bulk change "apply No Rule" to "apply generic rule"
« Reply #1 on: August 05, 2016, 16:45:02 pm »
UPDATE `#__virtuemart_product_prices` SET `product_tax_id`= 0 WHERE `product_tax_id` = '-1'
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chill_e_g

  • Beginner
  • *
  • Posts: 36
Re: Bulk change "apply No Rule" to "apply generic rule"
« Reply #2 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.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10422
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Bulk change "apply No Rule" to "apply generic rule"
« Reply #3 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chill_e_g

  • Beginner
  • *
  • Posts: 36
Re: Bulk change "apply No Rule" to "apply generic rule"
« Reply #4 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"

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10422
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Bulk change "apply No Rule" to "apply generic rule"
« Reply #5 on: August 08, 2016, 11:08:30 am »
adjust this ->  WHERE `product_tax_id` = '-1' to what ever u want changed
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chill_e_g

  • Beginner
  • *
  • Posts: 36
Re: Bulk change "apply No Rule" to "apply generic rule"
« Reply #6 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?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10422
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Bulk change "apply No Rule" to "apply generic rule"
« Reply #7 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chill_e_g

  • Beginner
  • *
  • Posts: 36
Re: Bulk change "apply No Rule" to "apply generic rule"
« Reply #8 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

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10422
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Bulk change "apply No Rule" to "apply generic rule"
« Reply #9 on: August 08, 2016, 21:44:05 pm »
Yes! genetic is 0 .. that is what the query does..

Check directly in your table
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10213
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Bulk change "apply No Rule" to "apply generic rule"
« Reply #10 on: August 09, 2016, 23:01:31 pm »
Yes! genetic is 0 .. that is what the query does..
right!
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/