VirtueMart Forum

VirtueMart General => Commercial Jobs => Topic started by: JeffRozar on February 24, 2010, 21:33:06 PM

Title: Need a variable price for a product
Post by: JeffRozar on February 24, 2010, 21:33:06 PM
I need to be able to add a product in Virtuemart that can have a user-input price. The product is for a maintenance contract, and varies per customer and per year. I want to be able to process this through Virtuemart.

Optionally, it would be great if I could just give the customer a link with the $ amount and that would display.

Anyone interested?
Title: Re: Need a variable price for a product
Post by: pieterkeuzenkamp on February 28, 2010, 21:12:19 PM
Hi I can do this for you, I already made a simular productpage for another customer you can see it live on www.tawel.net.

Let me know if you want it done!

Greetzz,

Pieter
Title: Re: Need a variable price for a product
Post by: dangdesigns on March 10, 2010, 18:15:57 PM
That is exactly what I need - sending an email to your yahoo address listed on profile.
Title: Re: Need a variable price for a product
Post by: dangdesigns on April 13, 2010, 04:00:23 AM
Sent email & pm - no response.
Title: Re: Need a variable price for a product
Post by: geraint on September 13, 2010, 17:33:07 PM
I figured this out and thought I'd post it here for the benefit of others who are looking for it.

1. I added an attribute to my product called "ManualPrice"
2. I added these 3 lines of code in ps_product.php at line 1910                 if ($this_key=="ManualPrice"){
                    $adjustment = floatval($this_value);
                }
just before                 if( isset( $product_attributes[$this_key]['values'][$this_value] )) {


Now when you enter a value in the ManualPrice field and add it to the cart it picks up the variable price.
Title: Re: Need a variable price for a product
Post by: kempfta on September 15, 2010, 23:20:29 PM
Very interested in a variable priced product too, I have gift cards I sell and can make them any value the customer wants. Will save me from creating a ton of set priced gift cards.

I tried the change you described, which version of Virtuemart did you modify? I am running 1.1.4. What did you price your product at initially $0.00?

Can you clarify how exactly u added the attribute "ManualPrice"?
Title: Re: Need a variable price for a product
Post by: celestialcitizen on September 18, 2010, 19:34:48 PM
Hi

You need to add the manual price as an attribute. (refer snapshot)

And then you will also have to modify the flypage to make it a textbox. (refer to second snapshot)



[attachment cleanup by admin]
Title: Re: Need a variable price for a product
Post by: bmherard on October 13, 2010, 03:51:01 AM
This is great and very useful. Two questions though...

1. How did you make the "ManualPrice" a fillable textbox

2. Is it possible not to display "Price: $0.00"
Title: Re: Need a variable price for a product
Post by: celestialcitizen on October 13, 2010, 19:09:30 PM
u have to hack the browse page to get a text box.

Also mind you since you are asking users to enter a price you have to do validation to see to that only numeric values are added
Title: Re: Need a variable price for a product
Post by: bmherard on October 14, 2010, 04:55:29 AM
Quoteu have to hack the browse page to get a text box.

Also mind you since you are asking users to enter a price you have to do validation to see to that only numeric values are added

I'm very new to VirtueMart...how is this hack accomplished?
Title: Re: Need a variable price for a product
Post by: MagnumKYO on August 11, 2011, 11:01:59 AM
After reading above posts i managed to make a text box of manual price in product. but cant add it in cart. after reading i knew that modify flypage to get add cart button in manual price. my question and problem s that how can i modify flypage so i can have add to cart button on manual price box. Thanx and waiting passionately cuz really stuck on it.
Title: Re: Need a variable price for a product
Post by: MagnumKYO on August 13, 2011, 16:04:10 PM
can anybody help?
Title: Re: Need a variable price for a product
Post by: gost on August 13, 2011, 20:23:44 PM
I able to do this  for you at very low  rate.you just PM me for this if you want any help in this regard.
Title: Re: Need a variable price for a product
Post by: voodoorhino on August 16, 2011, 19:52:17 PM
I have the box and the settings above, but for some reason it won't allow manual input.
Anyone have full code and files to modify?
Title: Re: Need a variable price for a product
Post by: Thijmen1992 on September 23, 2011, 14:39:36 PM
Anyone got this working? I only get a dropdown :(