News:

Support the VirtueMart project and become a member

Main Menu

Change to Apply no rules

Started by jesussuarez, January 03, 2016, 13:24:50 PM

Previous topic - Next topic

jesussuarez

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

#___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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jesussuarez

Thank you very much !!! I'll probe it :)

Best regards !!

jesussuarez

Work's perfect. Now the "Final price" of all the products are set in "No apply rules".
Thank you very muuuuch !!! Huge regards :)

jesussuarez

Some solution to have "No Apply rules" by default?

GJC Web Design

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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jesussuarez

Yeahhh. Thank you very much !!!

:)

tkoletsis

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

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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation