Author Topic: Custom fields - Final Price  (Read 9247 times)

bitstomper

  • Beginner
  • *
  • Posts: 19
Re: Custom fields - Final Price
« Reply #15 on: May 29, 2012, 23:24:29 pm »
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

  • Beginner
  • *
  • Posts: 12
Re: Custom fields - Final Price
« Reply #16 on: August 04, 2012, 08:51:20 am »
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

Code: [Select]
$free = JText::_ ('COM_VIRTUEMART_CART_PRICE_FREE');
chenge to   
Code: [Select]
$free = round($product->product_price,2) . "$" ;   


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


Code: [Select]
$price = strip_tags ($currency->priceDisplay ($calculator->calculateCustomPriceWithTax ($productCustom->custom_price)))  ;
change to:

Code: [Select]
$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

  • Beginner
  • *
  • Posts: 32
Re: Custom fields - Final Price
« Reply #17 on: November 15, 2012, 18:07:00 pm »
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

  • Beginner
  • *
  • Posts: 12
Re: Custom fields - Final Price
« Reply #18 on: December 01, 2012, 01:41:51 am »
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

  • Beginner
  • *
  • Posts: 20
Re: Custom fields - Final Price
« Reply #19 on: March 20, 2014, 00:58:16 am »
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?