开发者

price increments for each price tier

In magento I use 2 price tiers, one for 6 boxes at £3.50 per box - and another tier for a crate of 24 at 2.40 per box, which all works fine, with increments set at 6, however, what I need is for orders of 6 boxes at increments of 6 until they reach a quantity of 24 boxes, then the increments 开发者_JAVA百科to go up by 24 each time, not 6,

is this possible?

I hope that made sense


This is possible with some custom code in your product/view. The general idea is that you have something like this:

A theme over-ride for the affected products. This need not consist of anything more than the product page phtml template files and the normal path for it, placed in app/design/frontend/default/thingy/template path. You then set your special products to this theme, the other files, e.g. for the header, footer will be picked up from the main store theme.

Set your products to use the new 'theme'.

On your custom templates you put in an extra chunk of Javascript and an extra quantity box, give it an id of 'tieredqty'. Use Prototype on DOM load event to run your script.

At the top of the script use the $('id-for-normal-qty-box').hide(); to hide the quantity box that is submitted with the form.

In your own faux quantity box add an event observer. You can make it onkeypress and perform validation to make it numbers only. You can also make it copy the value to the hidden textbox. That value can be handled by your own logic to round up to the next tier.

You will not need to worry about 'bubbling' the onChange event to the hidden form item as the price on the page does not need to be dynamically updated to account for price.


You could edit the template file catalog/product/view/addtocart.phtml and replace the text input for quantity with a select that only has the multiples; 6, 12, 18, 24, 48, 72, 96, etc... (This does affect all products but there are ways of selectively applying to only some)

Unfortunately that won't stop a customer from going back to the product page more than once. For example they might add 24 to their cart, then add 6, then get the tier price for 30. Also (depending on theme) they can simply edit the quantity on cart page directly. The only way to prevent that is to inspect the cart's contents, perhaps during checkout.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜