Can I show the stock level on a catalog page. So that users know that a product is sold out or how many are in stock!
Thx
|
Ubercart |
|
|
|
||
|
Mon, 03/31/2008 - 16:11
Can I show the stock level on a catalog page. So that users know that a product is sold out or how many are in stock! Thx
I'm also interested...
I'm also interested in customizing the catalog page ... It would be nice if you had an option to show stock levels and a fast add to cart button or link. Less clicks for the users viewing the store. Good with CSS - Bad with Code.
Re: Stock level on catalog page
To show the "add to cart" button that's possible. I don't know where to set this option at this moment, but I thought you can do it by shop configuration and then catalog. But there you can't set the option to show the stock level on the catalog page.
Re: Re: Stock level on catalog page
Have you guys checked out Inventory API & Simple Stock levels?: it is really sweet. If you can print out the levels of stock on admin, then yes, you will be able to do it front-end. U just need to add the "stocklevels" from /admin/content/types/product/fields Would be a nice addition.. Will post if I have success..
Re: Stock level on catalog page
I'm currently working on code that provides Views integration for Ubercart Attributes: http://www.ubercart.org/contrib/3960 The code includes some Stock integration (i.e. you can choose to display only those products that are in stock). Including a stock level field as part of that code wouldn't be difficult. This would provide you the ability to make a view that showed the stock level of a product with a specific set of attribute options. The specific set of options could be chosen by an option select box in the Views edit page, and the default would be to show the stock level for a product with no attributes or attribute options. Admittedly, this doesn't get the Stock level built into Ubercart's catalog feature, but if you're comfortable using Views, this should do exactly what you want. I suspect I won't be able to work on this feature until sometime next week, but let me know if this is what you're looking for and I'll make sure to put it on my To-Do list.
Theme snippet for stocklevel display on product pages
Maybe this is usefull to somebody: It displays a small table with the current stocklevel of all stock-enabled SKU's for a product. <?php Put it in the node.tpl.php, and print the var $stock_html in a proper place. Feel free to ask. Regards, Kees
Re: Theme snippet for stocklevel display on product pages
How do i make stock level by stores?. How do i make store level inventory for each product? How do i show which store the product is available? How do i show which store is nearer to a zip code (different ranges).
Re: Re: Theme snippet for stocklevel display on product pages
How do i make stock level by stores?. How do i make store level inventory for each product? How do i show which store the product is available? How do i show which store is nearer to a zip code (different ranges). Sorry, I don't know what youre talkin about. Ubercart IS a store. Just one.
Sweet keesje76,
is that
Sweet keesje76, Cheers for the share mate!
Re: Theme snippet for stocklevel display on product pages
I'm finding this theme snippet to be a real gem as it dramatically cuts down customer questions about particular product attributes being in stock. Placing the < ? php print $stock_html ? > in < fieldset class=" collapsible collapsed" > < / fieldset > tags, allows the table to be displayed in a collapsed field, which reduces screen clutter. Two Questions: 2) Also, this snippet only displays a decrease in stock when an item has been purchased. Is there any way to make it display a decrease when a product has been added to a cart, but hasn't yet been purchased. ^_^
Re: Re: Theme snippet for stocklevel display on product pages
Good suggestion, thanks for sharing. 2) This is the nature of Ubercart stock levels. I personally like it the way it is. is that using the simple stock levels?
Stock Level
Heyas Any update on this ? I sell a mixture of items that are "in stock" or "custom made" or "special ordered" Being able to show current Stock Level on product page helps provide a "Lead Time" for my customer base I am not good with coding so anything "point and shoot" is ideal for me
one simple approach
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:
Re: one simple approach
I modified below code to allow for stock levels on product attributes. Not elegant, but it works // ######### BEGIN CUSTOM CODING RELATED TO STOCK DISPLAY ###############
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:
It works nice except...
When
It works nice except...
Added, not working
Hey guys, I added the code from keyone to my template.php file and am now getting this error: Fatal error: Cannot redeclare uc_attribute_uc_product_models() (previously declared in /sites/default/modules/ubercart/uc_attribute/uc_attribute.module:347) in /sites/default/themes/twilight/template.php on line 124 I'm assuming I can re-declare the uc_attribute_uc_product_models() function??? Update: Any help would be great, thanks...
Re: Re: one simple approach
My theme doesn't have a template.php file
Does it work for 6.14?
It could be very useful function, but it doesnt work for me on Drupal 6.14. I am not coder. Have I missed something?
Re: Re: one simple approach
I've been looking around for a fix like this for ages - great work, thanks. There was one change I made, and some other people seem to be having the same issue. A redeclare error came up because the code is trying to build a function when uc_attribute.module already has one by the same name. i just changed the function name to uc_stock_attribute_uc_product_models.
Re: one simple approach
Thanks so much for this code snippet. I was using http://drupal.org/project/uc_out_of_stock, but the ajax made my site run slow on the grid product pages. This seems like a much more efficient and easy way to do what I wanted, and the bonus is that I'm able show a status of "In Stock" on my product page.
frost wrote:
Here's a simple
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: I tried this one as well, even putting <?phpin the product page. It doesn't do anything. What am I doing wrong? Everyone else seems to have it working.
Out of stock script
I tried: function phptemplate_uc_product_add_to_cart( $node ) {which works just fine with D6 / U2.
Display order
Did anyone had succes displaying the stocklevels of options in the right order (same order as the options itself are ordered)? I'm struggling with this, I believe it's imposible. Any help greatly appreciated!
Re: Display order
More info and ugly fix for anyone interested:
doesn't like line 3
<?phpIf I put this in the end of my node.tpl.php, I get:
Where line 36 is: It doesn't seem to matter which theme I use. My setup is Drupal 6.14, Ubercart 6.x-2.0.
Re: Theme snippet for stocklevel display on product pages
#ryank76
Re: Stock level on catalog page
The function uc_stock_skus() to have vanished from the module, just add the function to your template.php
Re: Re: Stock level on catalog page
Thanks for pointing out! -----------
in template.php:
function
in template.php: function uc_stock_skus($nid) {and in node-product.tpl.php <?php
Re: Stock level on catalog page
Slightly off-topic: I want to be able to sort on the stock value. That is, if a stock is below 1 (<=0) than I want these products to be last in the row. Thanks in advance. ----------
Modified for those products that do not have stock active
I modified Keyone's code for those products that do not have stock tracking active. I was also getting WSOD if the stock tracking was not active so I use the drupal_get_form function instead to call up the normal add to cart form. I hope it helps someone as much as Keyone's code helped me. // ######### BEGIN CUSTOM CODING RELATED TO STOCK DISPLAY ###############
Nice work Imrubio,
it works beautifully! <?php
Re: Nice work Imrubio,
It works but after use does not work module "attribute stock filter" (http://drupal.org/project/uc_attribute_stock_filter)
change $stocklevel to $stockactive
Hi Lindenlion, I was still getting the 'Sold Out' message when stock levels were activated and set to a positive number. I found that the variable $stocklevel was never set in the version I posted so changing that to $stockactive does the trick. Here's the new code. <?php
Re: Stock level on catalog page
Very interesting reading here.. Has anyone had any experience with using any of these solutions at the same time as Ubercart Out of Stock module? At the moment I'm still wading through all the various choices for stock level display and stock control. thanks,
Re: Re: Stock level on catalog page
Just to update that I've added imrubio's script above, as well as the "uc out of stock" module on my test site. So far all is working well, with a mixture of products with and without stock tracking enabled.
I am using the Stock Notify
I am using the Stock Notify module so people can sign up when item is back in stock.... when i added imrubio's show stock levels' script above it doesn't work anymore i think since they both messing with uc_product_add_to_cart_form? Has anyone got both working together? EDIT: When using drupal_get_form, it completely avoided the Stock Notify page, it went to the page where it says if a product is out of stock... but it would say the wrong product in that message for some reason...
Re: Stock level on catalog page
Has anyone solved the issue of people being able to buy more products than are in stock?
The topic has not even been touched..
Topic is - "Stock level on catalog page"....... not product pages.... I would like to show stock levels on the catalog page for each item under that taxonomy vocabulary. You have provided solutions for product pages and I have used them.. Thank you.. Any idea's. Thanks.
Hacked it... but it works!!!
I now have stock counts displaying below the Add to Cart button in the catalog page... in - uc_product.module - around line 1419-1435 $stock = db_fetch_object(db_query("SELECT active, stock FROM {uc_product_stock} WHERE nid= '$node->nid'", $sku));I added this to print the stock levels where I wanted them. "In Stock: $stock->stock" |
|