Author Topic: Change to Apply no rules  (Read 1503 times)

jesussuarez

  • Jr. Member
  • **
  • Posts: 57
Change to Apply no rules
« on: January 03, 2016, 13:24:50 pm »
Hello !!

I have more than 500 products with "Apply generic rules" and now, I need to create discounts to some products.
The problem is that when I create a disccount rule, all the products are affected because all the products have "Apply generic rules" selected  :(

How can I change all the products to "Apply no rules" ? It's possible to get it via PHPMyAdmin?
Please, someone can say me what's the code to execute?

Or can I use another method to change all the products to "Apply no rules"?
Or another solution to assign diferent disccounts to diferent products having "Apply generic rules" selected?

Thank's in advance
Best regards :)

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9023
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Change to Apply no rules
« Reply #1 on: January 03, 2016, 13:44:30 pm »
#___virtuemart_product_prices ->  product_discount_id -- set to -1

UPDATE `xxxx_virtuemart_product_prices` SET `product_discount_id`= '-1' WHERE `product_discount_id` = 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

jesussuarez

  • Jr. Member
  • **
  • Posts: 57
Re: Change to Apply no rules
« Reply #2 on: January 03, 2016, 13:56:36 pm »
Thank you very much !!! I'll probe it :)

Best regards !!

jesussuarez

  • Jr. Member
  • **
  • Posts: 57
Re: Change to Apply no rules
« Reply #3 on: January 04, 2016, 02:36:59 am »
Work's perfect. Now the "Final price" of all the products are set in "No apply rules".
Thank you very muuuuch !!! Huge regards :)

jesussuarez

  • Jr. Member
  • **
  • Posts: 57
Re: Change to Apply no rules
« Reply #4 on: January 04, 2016, 02:43:03 am »
Some solution to have "No Apply rules" by default?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9023
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Change to Apply no rules
« Reply #5 on: January 04, 2016, 10:50:22 am »
hmmm .. it is NULL in the DB

the select is formed here

administrator\components\com_virtuemart\views\product\view.html.php  ->  function renderDiscountList($selected,$name='product_discount_id'){

called here  administrator\components\com_virtuemart\views\product\tmpl\product_edit_information.php  ->

if (!isset($this->product->allPrices[$k]['product_discount_id'])) {
            $this->product->allPrices[$k]['product_discount_id'] = 0;
         }
         $this->lists['discounts'] = $this->renderDiscountList ($this->product->allPrices[$k]['product_discount_id'], 'mprices[product_discount_id][' . $this->priceCounter . ']');


change to

$this->product->allPrices[$k]['product_discount_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

jesussuarez

  • Jr. Member
  • **
  • Posts: 57
Re: Change to Apply no rules
« Reply #6 on: January 04, 2016, 16:48:08 pm »
Yeahhh. Thank you very much !!!

:)

tkoletsis

  • Beginner
  • *
  • Posts: 4
Re: Change to Apply no rules
« Reply #7 on: August 18, 2019, 14:56:36 pm »
Hello,

I have the same issue too.

I would like this setting to be permanent
If a newer version of virtuemart is installed, this setting will be lost?
Can i make an assignment of this setting in my templates folder ?
In which path?

Thanks in advance
Theo

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9023
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Change to Apply no rules
« Reply #8 on: August 18, 2019, 15:57:15 pm »
just over ride it in your admin template .. e.g. isis

public_html\administrator\templates\isis\html\com_virtuemart\product\product_edit_information.php
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