how to create a custom relationship between price and product quntity

Started by GuilhermeSilveira, July 12, 2012, 04:24:10 AM

Previous topic - Next topic

GuilhermeSilveira

Hi Guys!

I'm new in VM and I want to know if someone knows how to create a custom relationship between price and selected product quantity in the product details page.
I need to show (using JQuery) diferent prices for each time the quantity is changed in the input box of quantity.
For exemple:
I have a product with price $10.00 and the quantity input box is 1.
If I change the input box to value 2 the price needs to be $20.00.

In what script can I change this?

John2400


GuilhermeSilveira

Thanks John2400!

It was a great hint!

But unfortunately it is paid and I'm trying some customizations in the VM for non commercial use. For awhile, I hope.
So I want to make some changes in the JQuery/Ajax/PHP code.

The whole idea is:

1 - Show the ordered product quantity of each product in its detail page. The price of the product needs to depend of this quantity.

For example:

The product "A" costs $100 and already has 50 items sold and its price will be from $100 to $80 because I already have this 50 items sold.
When its detail page is loaded needs to have a calculation of how many items were sold to give a certain price. In this case the result will be $80.

2 – After the detail page is loaded it needs to calculate as I explained in my first explanation in this post ("I need to show (using JQuery) diferent prices for each time the quantity is changed in the input box of quantity"). But this quantity needs to be added with the product quantity sold to give an instant discount because I need this discount before send this product to the cart.

My question is: In which script I do this two modifications? And in what piece of code can I do this?

Can anyone help me with it?