News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Price Overrides

Started by nickwiebe, May 06, 2013, 17:36:51 PM

Previous topic - Next topic

vassilis3

Neither of the above two solutions (Jedson, Woop) was very helpful... It seems that Jedson's solution is closer to solving the problem, which is described below:
I was using the previous version of VirtueMart but I had to migrate (using the Migrator extension that migrates attributes) to the new one due to security reasons. The problem is that this extension didn't migrate the discount percentage on the prices as rules specific to product groups, as I suppose it should have, but rather as final discounted prices as overrides of the previous ones. So what should happen, and was happening with the older VirtueMart version is this:

(Core price – discount) + (additional cost due to product variation – discount) = final product price
http://www.diavgia.gr/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=1235&category_id=9&option=com_virtuemart&Itemid=73

Instead, below is what happens with the new version after having applied this rule [$this->productPrices['salesPrice'] = $product_override_price*1.23 + $salesPrice - $costPrice*1.23 ;]

(Core price – discount) + additional cost due to product variation.
http://www.fotistika.net/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=1235&virtuemart_category_id=31&Itemid=

I am all ears!

woop

Hi Basilis,

Do not understand what u´re looking for exactly... but i promise you that with the solution I posted (even if it´s hacking VM2 core) I got exactly what I am discribing (the problem I had and the solution I got). The info it´s just as an example (solved) of my case. I´m sorry this didn´t help u as you expected :P

If you wanna check the website where I did applied that you can go to www.gasfriocalor.com do the experiment with some product with a discount applied if you wanna experience the difference.

Lots of light dudes!!
Kind Regards,
Daniel Mateu Solé

vassilis3

Thanks for the reply but it still dosent work

tomas.strans

Hi guys...

I tried all of yours tips and still doesn't work! Even I tried to copy calculationh.php from WOOP, nothing happen!

I'm using JOOMLA 2.5.19 and VM 2.0.26d

So do you have any idea what can I try to fix it??? Or if anybody have a working this funkcion (overwrited final price include price of custom fields), can you send me files making this change?


Thanks, Tom

kalaxal

I can confirm that this worked for my situation but seriously Virtuemart Team you guys need to address this. The fact that it has been reported 20 or so versions ago. Come on

woop

Quote from: kalaxal on April 07, 2014, 22:29:21 PM
I can confirm that this worked for my situation but seriously Virtuemart Team you guys need to address this. The fact that it has been reported 20 or so versions ago. Come on
Kalaxal, I agree with u but we still have to be happy with the excelent work of VMTeam and keep posting issues we find + post solutions we find :)

Quote from: tomas.strans on April 06, 2014, 19:44:19 PM
Hi guys...
I tried all of yours tips and still doesn't work! Even I tried to copy calculationh.php from WOOP, nothing happen!
I'm using JOOMLA 2.5.19 and VM 2.0.26d
So do you have any idea what can I try to fix it??? Or if anybody have a working this funkcion (overwrited final price include price of custom fields), can you send me files making this change?
Thanks, Tom
Tomas.strans regarding the solution I found and post in hear (at leat works perfectly for me on my versions of Joomla+VM) please note I´m using prices modifier (type DBTax) I wanna appoint you this strongly due the type of "price modifier" you use is important in my hack due that´s the only case where it´s applied :P ...you can also open my files and check/modify ;)
Kind Regards,
Daniel Mateu Solé

rido21

This solution worked for me!
J. 2.5.19 with VM 2.6.0

However, I solved one more problem that I had.
This was that the value of custom field is influenced by default tax rules.

My solution for this problem:
Edit the line 1628 in administrator/components/com_virtuemart/helpers/calculationh.php

$modificatorSum = $modificatorSum + $productCustomsPrice->custom_price;

and add this:
$modificatorSum = $modificatorSum + ($productCustomsPrice->custom_price / 1.23);


(1.23 is the tax in my country)

Quote from: jedzon on May 26, 2013, 09:10:02 AM
Hi,

I belive that is exacly what we are looking for. Please look at: http://e-slubny.com.pl/index.php/component/virtuemart/suknie-slubne/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

I can not find function coresponding for variant cost so I add few other variables which gave me same effect:

$product_override_price - this is price with discount
$salesPrice - this is price without the discount but with cart variant value
$costPrice - this is net price without cart variant value

For example:
Oryginal product is 2000
Discounted prodvuct value is: 1500
Additional fee: 50

$this->productPrices['salesPrice'] = $product_override_price + $salesPrice - $costPrice*1.23 ;

And we have: 1500 (discounted) + 2050 (price with additional fee) - 1626 (net price before discount and without additional fee) * 1.23 (this is tax in my country so I need to make price with tax) = 1550 (discounted price with additional fee)

If think you need same rules, but if you need price without tax you just should remove tax frome code.

Hopy you will understand what I'm mean becouse my english is not perfect :-)

Hope this will work for you too.
Please let me know.


Regards,
Karol

jjferre

Hello , I have the same problem. When a VM product has custom fields with variable carriage , the amount of custom field is added to the sale price , but not the final price.

You can tell me please what is the I took a month trying to fix it and do not like solution.

The VM version I'm using is 2.6.10

Attached here the file I edited unsuccessfully in : administrator / components / com_virtuemart / helpers / calculationh.php

https://www.dropbox.com/s/4syrcheusrwaz35/calculationh.php?dl=0

Thank you very much , I hope for your answer.

alinajenon

Thank you!  These are the answers I needed!!! Much gratitude. :)

DayCounts

I have a solution without hack available there:
https://www.daycounts.com/shop/virtuemart-3/price-override-w-attribute-fix.htm

Just need to install a plugin and create a new calculation rule and you are good to go.
Works only with "override price to be taxed"

savvy

Hi ,

just open "/administrator/components/com_virtuemart/helpers/calculations.php"

find this : "return $this->productPrices;"
AND put above it :


if($this->productPrices['variantModification']!=0) {
         
         $this->productPrices['discountAmount'] += $this->productPrices['variantModification']  ; // for displaying !
         $this->productPrices['salesPrice'] += $this->productPrices['variantModification']  ; // for paymeny
         $this->productPrices['basePrice'] -= $this->productPrices['variantModification']  ; // optional
         
      }


Henrik Holm Nielsen

savvy,

Thanx for this hack - however it seems the hack does not take any taxrules into account :(
For now I have modified the rules manually, by just hardcoding my taxrate into the rules - but do you have a take on how this could be done, if one wants to use the taxrules in the system instead?

Cheers
/Zorroson :)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Billigt og professionelt design af din hjemmeside | Brug for en billig, flot og professionel hjemmeside?