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
|
Ubercart |
|
|
|
||
|
Fri, 07/18/2008 - 09:36
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,
Re: Stock level on product detail page
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.
Re: Re: Stock level on product detail page
It'd be nice if the product description would accept ubercart tokens. This kind of functionality is already provided in How do we do that (or make the template do that) for the product description? (P.S. I'm very new to Drupal/Ubercart.)
Re: Stock level on product detail page
Anyone have any luck with this one or done similar? I really want to implement this, but not sure where to start. =(
Re: Re: Stock level on product detail page
There is a pretty cool solution around. You need to put some code into your template.
Re: Stock level on product detail page
I am really stuck on how to add stock level to my product list pages. I have successfully added the stock level to my product detail pages thanks to frost's post quoted below. (which works beautifully!) I am using Ubercart for more or less a product inventory system, so it's important that I be able to show quantity of stock in a list view. Can anybody steer me in the right direction before I lose my mind? Here's a simple way to display stock level for nodes, and also to remove the "add to cart" button if the stock is zero. Add the following to the template.php file in your sites/all/themes/YOUR_THEME_NAME directory, changing the function name according to your theme's name: function YOUR_THEME_NAME_uc_product_add_to_cart( $node ) {Note that there are some obvious limitations to this: |
|