Feature request: purchase product in required multiple quantities
Reported by BJ Kline | April 24th, 2015 @ 07:19 PM
I have a product I will be selling that only comes in multiples of 5. The customer should not be allowed to order say 8 of this item. If they try to order 8 then the system needs to automatically adjust to 10. I have set the Minimum order quantity to 5, but I didn't see a way to handle more than 5. Is there a way to make this happen in Exponent?
Comments and changes to this ticket
-
BJ Kline April 25th, 2015 @ 08:14 PM
An acceptable solution is to have the Quantity auto-adjusted up or down to nearest multiple.
-
BJ Kline April 28th, 2015 @ 02:00 PM
So I've been looking around to see if I can come up with a solution. I found a formula that will do the adjusting.
if (pkg_qty % o_pkg_qty != 0) { pkg_qty = (Math.floor(pkg_qty / o_pkg_qty) + 1) * o_pkg_qty; jQuery('#desc' + trid_num).append('<br/><div class="blueBox">Package qty is ' + o_pkg_qty + ', qty updated to ' + pkg_qty + '</span>'); jQuery('#qty' + trid_num).val(pkg_qty);
I think you'd set o_pkg_qty = to the number you want to order, then pkg_qty = to the minimum order quantity. What I haven't been able to work out is how to implement this in Exponent.
-
BJ Kline April 28th, 2015 @ 06:24 PM
In my case this only needs to happen on products that have a minimum quantity value set. These products are only available as multiples of 5.
Could something like this work?
{$pkg_qty = $product->minimum_order_quantity} {$o_pkg_qty = $orderItem->quantity}
{if $orderItem->quantity >= 5 && $product->minimum_order_quantity == 5} //I'm not sure what Exponent uses to store the quantity {if pkg_qty % o_pkg_qty != 0 } ceil(pkg_qty / o_pkg_qty) + 1) * o_pkg_qty {/if} {/if} -
BJ Kline April 28th, 2015 @ 07:47 PM
How long until the new release? Is your approach currently in the development branch? I've got a bunch more products to include in the catalog yet, so the site's not ready to go live yet. However if there isn't a timeframe to implement this, I will have to switch to a different platform.
-
expNinja April 30th, 2015 @ 12:38 PM
- State changed from new to resolved
(from [e8d8083e0a20213d629f3623caf4f0fb6589635b]) E-Commerce: Order in multiple quantities [#1289 state:resolved] https://github.com/exponentcms/exponent-cms/commit/e8d8083e0a20213d...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Bug Tracker for Exponent CMS