#1289 ✓resolved
BJ Kline

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

    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

    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

    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

    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.

  • BJ Kline

    BJ Kline April 29th, 2015 @ 02:25 PM

    Yes these are 'parent' products.

  • expNinja

    expNinja April 30th, 2015 @ 12:38 PM

    • State changed from “new” to “resolved”

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.

New-ticket Create new ticket

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

Shared Ticket Bins

People watching this ticket