Zen Cart Logo
Forums / General Questions / how to show quantity when order is over available amount

how to show quantity when order is over available amount

Locked

Views: 1,186

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
22 Aug 2008, 6:45 PM
#1
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

how to show quantity when order is over available amount

Hello,
When someone adds an item to their cart that is over the quantity on hand, it marks the item in red in the shopping cart with ***. Is there a way to also show the customer how much quantity is available for this item so that they don't have to guess and keep entering a lower quantity and continue in circles until they get to an available amount?

22 Aug 2008, 8:51 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: how to show quantity when order is over available amount

Using your templates and overrides you should be able to use something like this ...

  if ($product['flagShowFixedQuantity']) {
    echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
  } else {
    echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'] . ($product['flagStockCheck'] ? ' left ' . zen_get_products_stock($product['id']) : '');
  }
22 Aug 2008, 9:17 PM
#3
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: how to show quantity when order is over available amount

Hi Ajeh,

Thanks for the reply.

I added this portion of the code because the other portion already exists:

($product['flagStockCheck'] ? ' left ' . zen_get_products_stock($product['id']) : '');
}

This is at the end of the code you provided. But now when I click on view cart, I get a blank page.

22 Aug 2008, 9:26 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: how to show quantity when order is over available amount

Could you post everything in that area from the starting <?php to the closing ?> ... approximately lines 68 - 74 ...

22 Aug 2008, 9:32 PM
#5
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: how to show quantity when order is over available amount

Hi Linda,
I'm so sorry. It works! I think I might have cut and paste the wrong way. So tried again and it works wonderfully!
Thanks so much.
Did you see a bug that I reported on my other thread in regards to able to checkout with insufficient stock in the general forum? I did a fresh install and did a test and the bug still exists in the fresh install.

22 Aug 2008, 9:35 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: how to show quantity when order is over available amount

Yeps ... now go post over there the info we need to help you out better ... :cool: