Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Show Quantity For Particular Products Or Categories Only Rate Topic   - - - - -

 
  • charlotted
  • Newbie
  • Trial users
  • Join Date: 03-Jul 17
  • 14 posts

Posted 11 October 2017 - 11:10 AM #1

Hi, 

 

I know it's possible to show product quantity for all items across the whole site, but I am hoping there is a way to show the product quantity for products in stock for certain categories (it may be possible through category templates). Or even having an option in the product to show the quantity when in stock (and still show "out of stock" when out of stock, and override the system's default. 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,923 posts

Posted 11 October 2017 - 12:51 PM #2

I know it's possible to show product quantity for all items across the whole site, but I am hoping there is a way to show the product quantity for products in stock for certain categories (it may be possible through category templates). Or even having an option in the product to show the quantity when in stock (and still show "out of stock" when out of stock, and override the system's default. 

 

Yes, you can do by creating new templates only. You can clone available templates in the following directory

 

design/themes/THEME/templates/blocks/product_list_templates

 

As a result they will be automatically available to choose on the Settings -> Appearance and category details page


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • charlotted
  • Newbie
  • Trial users
  • Join Date: 03-Jul 17
  • 14 posts

Posted 11 October 2017 - 02:10 PM #3

Thanks for your quick reply,

 

Is it possible to show the quantity on the product page itself?



 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3,406 posts

Posted 11 October 2017 - 09:27 PM #4

Is it possible to show the quantity on the product page itself?


Settings:Appearance:Show number of available products:

 
  • charlotted
  • Newbie
  • Trial users
  • Join Date: 03-Jul 17
  • 14 posts

Posted 12 October 2017 - 09:48 AM #5

Settings:Appearance:Show number of available products:

Hi, 

 

Thanks for you reply, however I meant show quantities on the product page for certain categories.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,923 posts

Posted 12 October 2017 - 01:07 PM #6

Hi, 

 

Thanks for you reply, however I meant show quantities on the product page for certain categories.

 

It also can be done with custom category templates. It is controlled by the $show_product_amount parameter when the product_data.tpl is called


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • charlotted
  • Newbie
  • Trial users
  • Join Date: 03-Jul 17
  • 14 posts

Posted 12 October 2017 - 01:50 PM #7

Hi, 

 

I am a beginner to this, please could you explain thoroughly the steps I need to take?



 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 2,159 posts

Posted 12 October 2017 - 05:47 PM #8

Hi, 

 

I am a beginner to this, please could you explain thoroughly the steps I need to take?

 

Hello!

 

Try to use the {hook name="products:product_amount"} hook that is defined in the product_data.tpl file.


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE
Testing by QA and personal manager for free.

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,923 posts

Posted 13 October 2017 - 05:58 AM #9

I am a beginner to this, please could you explain thoroughly the steps I need to take?

 

For example, if you clone the grid list template

 

design/themes/THEME/templates/blocks/product_list_templates/products_multicolumns.tpl

 

you will see several parameters in the this file like show_name, show_old_price, etc

 

You can add the show_product_amount one and check the result


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • charlotted
  • Newbie
  • Trial users
  • Join Date: 03-Jul 17
  • 14 posts

Posted 13 October 2017 - 08:47 AM #10

Hi, 

 

I have seen in the CS-Cart admin there is Products > Categories > (select a category) > Views > Products Details View. 

I have tried duplicating   design/themes/THEME/templates/blocks/product_template

and selecting the new template for the category i want. But when I update the template, it doesn't take effect in the product view for the product in that category. 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,923 posts

Posted 13 October 2017 - 01:12 PM #11

Hi, 

 

I have seen in the CS-Cart admin there is Products > Categories > (select a category) > Views > Products Details View. 

I have tried duplicating   design/themes/THEME/templates/blocks/product_template

and selecting the new template for the category i want. But when I update the template, it doesn't take effect in the product view for the product in that category. 

 

May be cache issue?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • charlotted
  • Newbie
  • Trial users
  • Join Date: 03-Jul 17
  • 14 posts

Posted 13 October 2017 - 03:15 PM #12

Hi, 

 

I've tried that. 

 

Could there be any other product template which is used instead?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,923 posts

Posted 16 October 2017 - 07:16 AM #13

Hi, 

 

I've tried that. 

 

Could there be any other product template which is used instead?

 

3rd party addons can also use hooks in these templates


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • charlotted
  • Newbie
  • Trial users
  • Join Date: 03-Jul 17
  • 14 posts

Posted Yesterday, 09:08 AM #14

Hi, 

 

Thanks for your help with this. 

 

When I go to Products > Categories > (select a category) > Views > Product details view:

the new product template which I created, appears. 

 

So I select that product template and click Save. 

 

I've made a small change to the product template file, but this is now showing on the frontend. So it's like the new template save hasn't worked. I'm assuming this is a caching issue? Could it be anything else?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,923 posts

Posted Yesterday, 01:50 PM #15

Hi, 

 

Thanks for your help with this. 

 

When I go to Products > Categories > (select a category) > Views > Product details view:

the new product template which I created, appears. 

 

So I select that product template and click Save. 

 

I've made a small change to the product template file, but this is now showing on the frontend. So it's like the new template save hasn't worked. I'm assuming this is a caching issue? Could it be anything else?

 

Try to delete var/cache directory and check


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • charlotted
  • Newbie
  • Trial users
  • Join Date: 03-Jul 17
  • 14 posts

Posted Today, 07:44 AM #16

That's great thanks!

 

Ok, so this hook is not displaying anything:

{hook name="products:product_amount"}

 

In the overall settings for the site, the product quantity is off, so I just need to override that for products in a certain category. 



 
  • charlotted
  • Newbie
  • Trial users
  • Join Date: 03-Jul 17
  • 14 posts

Posted Today, 08:00 AM #17

Its the 'in stock' number which I want to show



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,923 posts

Posted Today, 01:35 PM #18

That's great thanks!

 

Ok, so this hook is not displaying anything:

{hook name="products:product_amount"}

 

In the overall settings for the site, the product quantity is off, so I just need to override that for products in a certain category. 

 

Sorry, your message is not quite clear. Please clarify


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия