tucstore Posted March 25, 2021 Share Posted March 25, 2021 is there a module that can display number of products : on my home page Link to comment Share on other sites More sharing options...
harrisorganic Posted January 24, 2022 Share Posted January 24, 2022 Hi Tucstore, Seems there is no module. I suppose you could write a line of code with a global stock number Is there a module or code that can display the number of items of each product available for sale? Please see the picture below. regards Duncan Link to comment Share on other sites More sharing options...
Dirty Butter Posted January 24, 2022 Share Posted January 24, 2022 Is this what you had in mind? Look at the top of the left hand column. https://plushmemories.com/lovie-shoppe/index.php If so, Bsmither gave me that code and I can hunt it up for you. Link to comment Share on other sites More sharing options...
harrisorganic Posted January 25, 2022 Share Posted January 25, 2022 Hi DB, Instead of a total number of items, I am after the number of items available for sale of each item. Instead of it being a global specification, could it be item specific? Whether it be tickets to a concert or bottles of wine on a specific page. This info can be found in the Specifications tab of an item on stock foundation skin. Here is an example of the amount of stock available, used on Ebay. Link to comment Share on other sites More sharing options...
bsmither Posted January 25, 2022 Share Posted January 25, 2022 We know that CubeCart makes this data available on the View Product page. You also want this data available to be shown on the HomePage "Latest Products". (Unless I am looking at code from one of my many mods) This data is already made available - we just need to code the template statement to show it. In the template file content.homepage.php: Find some code that looks like: <h3><a href="{$product.url}" title="{$product.name}">{$product.name|truncate:38:"…"}</a></h3> After that, add: <h4>{$product.stock_level} available</h4> This shows the main stock level. Products that have distinct stock levels assigned to specific option combinations, where the main stock level is set to zero, will show zero. Link to comment Share on other sites More sharing options...
harrisorganic Posted January 27, 2022 Share Posted January 27, 2022 Thanks Brian,, Many thanks for your reply. Latest products is a good answer with little coding. See https://www.harrisorganicwine.com.au/shop/ Although this info can be found in the Specifications tab of an item on a stock foundation skin and used in latest products as below Is it possible to have the latest products with " <h5>{$product.stock_level} available</h5> " inserted in the item as shown above, on a page like: https://www.harrisorganicwine.com.au/shop/events.html Link to comment Share on other sites More sharing options...
bsmither Posted January 27, 2022 Share Posted January 27, 2022 That would be the content.category.php template. This template has two views: a "list" mode and a "grid" mode (like Latest Products). The solution for the grid-mode should be the same for Latest Products. For the list-mode: Near line 122, find: {elseif !$CATALOGUE_MODE} <div class="row collapse"> <div class="small-12 columns"> <input type="submit" value="{$LANG.catalogue.out_of_stock_short}" disabled class="button disabled expand small"> </div> </div> {/if} Add after: <div class="row collapse"><div class="small-12 columns text-center">{$product.stock_level} available</div></div> The code for grid-mode starts a few lines later. Link to comment Share on other sites More sharing options...
harrisorganic Posted January 30, 2022 Share Posted January 30, 2022 Thanks Brian. Link to comment Share on other sites More sharing options...
harrisorganic Posted February 13, 2022 Share Posted February 13, 2022 Good morning, After clearing the system cache I found this intriguing example. A customer also reported seeing the same thing. ie 2 available and SOLD OUT. This item is a digital product as purchasers download a pdf file for more information. Has anyone seen this ? Link to comment Share on other sites More sharing options...
bsmither Posted February 13, 2022 Share Posted February 13, 2022 A digital product? Well, if I recall your situation, even this digital product has been configured to limit the sales of "tickets to this limited-seating event". Earlier, there was this disclaimer: "This shows the main stock level. Products that have distinct stock levels assigned to specific option combinations, where the main stock level is set to zero, will show zero." This implies that if all the product's options are zero, CubeCart considers the product sold out, regardless what the main stock level is at. For this product, are there any options? I see no reason for there to be any options, and the February 19 product is sold out (doesn't show options, if any). In admin, Store Settings, Stock tab, what is the setting for "Main stock level as matrix stock level summary". Link to comment Share on other sites More sharing options...
bsmither Posted February 13, 2022 Share Posted February 13, 2022 Here's an idea: instead of adding the new line of code after the existing code listed, add the new line before the existing code. This puts the new line of code within an if-block that only appears if the product is able to be sold. (It's redundant to say "Out of Stock" and "0 available" together.) Link to comment Share on other sites More sharing options...
harrisorganic Posted February 13, 2022 Share Posted February 13, 2022 Thanks Brian, Main stock level as matrix stock level summary is ticked. I have no idea what what "Main stock level as matrix stock level summary" means. Its always been like this. I could not find anything in the help section. For further events, maybe I would be better off to have a non - digital product to maintain stock levels of tickets. Then, any pdf or message can be emailed individually to the participants.? regards Duncan Link to comment Share on other sites More sharing options...
bsmither Posted February 13, 2022 Share Posted February 13, 2022 I will have to go back and see how you solved the "honor stock levels for digital products" situation. Link to comment Share on other sites More sharing options...
harrisorganic Posted February 14, 2022 Share Posted February 14, 2022 Is it possible to have a finite number of digital products? Just like non digital products. Link to comment Share on other sites More sharing options...
bsmither Posted February 17, 2022 Share Posted February 17, 2022 I thought that was already done? Otherwise, how do you get an Out-of-Stock indication? Or are these "tickets" not digital? Link to comment Share on other sites More sharing options...
harrisorganic Posted February 17, 2022 Share Posted February 17, 2022 The first product is digital and the second product is non digital. The digital product shows an infinite amount on the summary page. However the product page does show the number of items and does show an out of stock indication when there are none available. I need to be more explicit and ask how to change the infinite sign on the product inventory page to a number. Link to comment Share on other sites More sharing options...
bsmither Posted February 17, 2022 Share Posted February 17, 2022 In the admin source file products.index.inc.php, about 50 lines up from the bottom of the file: Find: $catalogue = Catalogue::getInstance(); $seo = SEO::getInstance(); foreach ($results as $result) { if ($result['use_stock_level'] == 0 || $result['digital'] > 0 || !empty($result['digital_path'])) { $result['stock_level'] = "∞"; } Change to: $catalogue = Catalogue::getInstance(); $seo = SEO::getInstance(); foreach ($results as $result) { // if ($result['use_stock_level'] == 0 || $result['digital'] > 0 || !empty($result['digital_path'])) { // $result['stock_level'] = "∞"; // } This bypasses the test that if the product is ignoring stock levels, or is a digital product, then show an infinite amount available. Link to comment Share on other sites More sharing options...
harrisorganic Posted February 17, 2022 Share Posted February 17, 2022 Fantastic. Many thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.