Show Quantity in Catalog Mode?

  • Posts: 8
  • Thank you received: 1
12 years 4 months ago #54692

Hi again,

So far the only way I can get the quantity to show for a product is by switching our shop from catalog mode to store mode and using the Add to Cart module. Is there any way to just show the quantity (without any buttons) for a product in catalog mode?

Thanks for your help!
=Arydiel=

Please Log in or Create an account to join the conversation.

  • Posts: 82821
  • Thank you received: 13368
  • MODERATOR
12 years 4 months ago #54714

Hi,

There is no option for that. You will have to edit the file "show_default via the menu Display>Views and add the line of code:
<?php echo JText::sprintf('X_ITEMS_IN_STOCK',$this->element->product_quantity); ?>

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 1
12 years 4 months ago #55165

Thanks! That worked. Just one more question:The products with 'unlimited quantity are showing -1. Is there anyway to fix that?

Please Log in or Create an account to join the conversation.

  • Posts: 82821
  • Thank you received: 13368
  • MODERATOR
12 years 4 months ago #55174

You can do like that:
<?php if($this->element->product_quantity>0) echo JText::sprintf('X_ITEMS_IN_STOCK',$this->element->product_quantity); ?>

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 1
12 years 4 months ago #55204

Am I missing something - do I need to edit something in that last one? Or is there somewhere specific it needs to be pasted All it did was make it repeat itself : ie 1 item in stock 1 item in stock and it didn't seem to affect the -1 items in stock any different. I pasted it in as is in that same file.

Please Log in or Create an account to join the conversation.

  • Posts: 82821
  • Thank you received: 13368
  • MODERATOR
12 years 4 months ago #55233

You need to use that line of code instead of the previous one.

The following user(s) said Thank You: arydiel

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum