Feature request: purchase product in required multiple quantities
-
BJ Kline
An acceptable solution is to have the Quantity auto-adjusted up or down to nearest multiple.
-
BJ Kline
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
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
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.
-
BJ Kline
Yes these are 'parent' products.
-
expNinja
- 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.