The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Issue with quantity pricing on form

calibereqcalibereq Member
in Help edited April 2014
Hey guys, I would appreciate some direction here. I've set up a rudimentary form with quantity pricing set up for the HMAC validating with the idea that you set your default price with the logic of subtracting from it, but when testing my cart it keeps adding items in the quantity of the string of numbers :

13450 for qty 1: <option value="1{p-3450}">1</option>

21725 for qty 2: <option value="2{p-1725}">2</option>

Qty 3 works just fine.

Here's the full code, I am sure the solution is something really obvious so I'm prepared to be embarrassed :)
<form action="https://xxx.foxycart.com/cart"; method="post">
	<input type="hidden" name="name" value="Clarke Vantage 13" />
	<input type="hidden" name="price" value="5175" />
	<input type="hidden" name="image" value="http://xxx/images/clarke_vantage13_thumb.jpg"; />
	<input type="hidden" name="url" value="http://xxx/clarke-vantage13.html"; />
	<select name="quantity">
		<option value="1{p-3450}">1</option>
		<option value="2{p-1725}">2</option>
		<option value="3">3</option>
	</select>
	<input type="image" src="images/buybutton.gif" alt="Submit Form" />
</form>    
Tagged:
Comments
  • fc_adamfc_adam FoxyCart Team
    @calibereq,

    I believe you're actually running into a limitation of the product option modifiers in that you can't actually set a modifier on the quantity field. I want to confirm that with the team if that's an expected behaviour or an oversight on our side - we'll be back in touch soon.

    For what it's worth though - your code is all good :)
  • Thanks for the info Adam- is there a better way I should be building options that affect pricing? Have a great weekend!
  • fc_adamfc_adam FoxyCart Team
    @calibereq,

    At this point, if you add the price modifiers to other fields, it will work - but they currently don't apply when on the quantity field. To be honest - you probably don't need to take the approach you have with setting the price high and modifying it down for the quantity field. I'd suggest simply setting the price to 1725 and allowing the quantity to multiply the price as required.
  • Will do- thanks so much!
Sign In or Register to comment.