Stock level on product detail page

Posts: 8
Joined: 10/03/2007

Hi,

i successfully added the stock level to my product_list view. However, I'd also like to show the stock level directly on each products' page. Is there a way to do it?

Thanks,
Stephan

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

You can modify your template directly to include this... you have to use the function uc_stock_level() and pass in the SKU I believe for this to work properly... from the template, you could try using $node->model.

Posts: 57
Joined: 10/07/2007

Anyone have any luck with this one or done similar?

I really want to implement this, but not sure where to start. =(

Posts: 49
Joined: 09/20/2007
Uber Donor

There is a pretty cool solution around. You need to put some code into your template.
Check http://www.ubercart.org/forum/support/4037/stock_level_product_page . It's working fine!

Posts: 57
Joined: 10/07/2007

Thanks Snicers,

I had lost track of that post.

I have tried, it works great, now just to find out which file outputs the sku, add to cart button etc, so i can add it inline.

Cheers!

Posts: 2
Joined: 10/30/2008

It'd be nice if the product description would accept ubercart tokens.
Then in the product description we could write
"There are [stock-level] items in stock."

This kind of functionality is already provided in
Administer -> Store Administration -> Configuration -> Stock Settings
where we see in the "Message text:" box,
"This message has been sent to let you know that the stock level for the model [stock-model] has reached [stock-level]. ... "

How do we do that (or make the template do that) for the product description?
Other comments appreciated.

(P.S. I'm very new to Drupal/Ubercart.)

--

Drupal v6.6, Ubercart v6.x.2.x-dev