News:

Support the VirtueMart project and become a member

Main Menu

Custom fields - Final Price

Started by plastique, May 09, 2012, 16:23:01 PM

Previous topic - Next topic

bitstomper

You can have a look at how I managed to create custom calculations. Results get passed to the cart. In my case I had to write complex calculation for calculating pricing for curtains depending on a few factors including user input for width and height.
The solution is here: https://forum.virtuemart.net/index.php?topic=103218.msg342817#msg342817

It is worth checking out for some of you as you will understand structure of VM and how it deals with prices better.
Took me several days of digging.

Wish some developer would finally write a nice developers manual with this sort of stuff!!
Anyhow, hopefully this will help some people avoid a few headaches.


dorriGa

I was testing and found a little solution.

the code change is the file adminstrator/componente/com_virtuemart/models/customfields.php

line 841 aprox, for no FREE word, and show the corrent price in custom field

$free = JText::_ ('COM_VIRTUEMART_CART_PRICE_FREE');

chenge to   
$free = round($product->product_price,2) . "$" ;   


and for show final price, change every line like that:


$price = strip_tags ($currency->priceDisplay ($calculator->calculateCustomPriceWithTax ($productCustom->custom_price)))  ;

change to:

$price = strip_tags ($currency->priceDisplay ($calculator->calculateCustomPriceWithTax ($productCustom->custom_price))) + round($product->product_price,2) . "$" ;




Problems.. with two extra field, its a mistakle with the diferents values in another list. between custom field list and the anoter, dont change on the fliy the values.

Not work with two or more extra fields.... help any idea?



saludos!!

sorry my english, spanish its my first lenguage.

Tommi

Hi,
I have a problem. I need show final price in dropdown.
Please, see the attachment.
Can you help me?

A have a latest VM version.

[attachment cleanup by admin]

dorriGa

I use this custom fields for the full prices, but this only work for a single list, multiple lists prices get errors.
make a backup of customfields.php and upload this one attach
/administrator/components/com_virtuemart/models/

[attachment cleanup by admin]

cerhio

Quote from: Milbo on May 20, 2012, 16:22:49 PM
LoL, sorry, I dont get your problem.

Guys, the first thing you should do is to install the sample data. Then take a look on the product with id=1, we call it "Hand Shovel". There is exactly what you want since months.

Before screaming around, blaming and accusing people who debt you nothing is just ridicolous.  I say RTFM! Read the FAQ, look at the sample!

In Hand Shovel there are few products. I have to create many child items with own descriptions. In my case about 50. Thats a long story. I need one description and photo, for exampe HDD Seagate...
and list of options 100mb 200 mb 300 mb etc. 

And I need to set final price without +- calculations
100mb = 5usd
200mb = 7 usd

etc.

How can I manage this?