VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: jedzon on May 12, 2013, 23:43:23 PM

Title: Custom field not change price if discount is selected
Post by: jedzon on May 12, 2013, 23:43:23 PM
Hi,

Can anybody tell me how to add some additional fee if discount is selected?
If I add +50 from custom field this value is added to base price before discount, how to add it to price with discount?

Please look at: http://www.e-slubny.com.pl/index.php/component/virtuemart/suknie-slubne/suknie-slubne2013-03-12-09-13-24/elegancka-suknia-do-slubu-wykonana-z-organza-i-satyny-typ-sukni-to-linia-a-bez-ramiaczek-suknia-posiada-naturalna-talie-i-jest-warstwowa-detail?Itemid=0

My VM ver. 2.20.

Thanks,
karol
Title: Re: Custom field not change price if discount is selected
Post by: jedzon on May 13, 2013, 20:33:41 PM
Really, nobody know how to fix this?

VM team, help please!
Title: Re: Custom field not change price if discount is selected
Post by: dimitrakopouloslakis on May 20, 2013, 14:33:47 PM
I have exactly the same problem!
Please if anyone solve this let share the solution with us!
Thanks
Title: Re: Custom field not change price if discount is selected
Post by: jedzon on May 22, 2013, 11:03:04 AM
Hi,

I think, I have solution... After tree weeks.. I was try everything and...

Please open:
administrator/componensts/com_virtuemart/helpers/calculationh.php

find line similar to this: (around line 353)
$this->productPrices['salesPrice'] = $product_override_price

and change it to:
$this->productPrices['salesPrice'] = $product_override_price + $salesPrice - $costPrice*1.23 ;

(where 1.23 is tax in my country).

I found solution few minutes ago so I'm not sure if it's best one, but for me at the moment looks good :-)
Of course tax should be changed with variable, but for now it's just for testing...
Please, let me know if it working for you too. (I changed lot of code before I found this easiest soultion, so maybe some more changes you need to add - just let me know).
Hope this will work...

Regards,
Karol
Title: Re: Custom field not change price if discount is selected
Post by: simbus82 on July 15, 2013, 13:08:52 PM
For me it is not working.

This is a great problem: we must decide where the price of a custom field have to go!

For example with custom field i have added an "installation fee" for some product.

Price: 1000$
Discount: 20%
Installation: Yes = +50$ / No = 0$

Virtuemart now add 50$ before the price discounted. So if i have installation selected i have (1000$+50$) - 20% .... WRONG!!! A discount "eat" my installation fee!

"Installation" is a additional fee for example a real manual operation after the simple product sell.

So is impossible do this in VM 2.20 without editing the core.... but....


where is the code that say "apply custom field before the discount"?
Title: Re: Custom field not change price if discount is selected
Post by: PRO on July 18, 2013, 20:02:51 PM
Quote from: simbus82 on July 15, 2013, 13:08:52 PM
For me it is not working.

This is a great problem: we must decide where the price of a custom field have to go!

For example with custom field i have added an "installation fee" for some product.

Price: 1000$
Discount: 20%
Installation: Yes = +50$ / No = 0$

Virtuemart now add 50$ before the price discounted. So if i have installation selected i have (1000$+50$) - 20% .... WRONG!!! A discount "eat" my installation fee!

"Installation" is a additional fee for example a real manual operation after the simple product sell.

So is impossible do this in VM 2.20 without editing the core.... but....


where is the code that say "apply custom field before the discount"?

maybe try
http://forum.virtuemart.net/index.php?topic=99906.0


or a child product for the install fee