- Posts: 209
- Thank you received: 18
Show stock available in a product list
13 years 8 months ago #84303
by JIK
Show stock available in a product list was created by JIK
Hi, I have a standard Joomla menu item which is a Hikashop "product listing" type showing all the product within a specific category. The Hikashop options for this menu are:
Type of content = product
Type of layout = list
Display 'Add to cart' button = No
Link to the product page = No
I have two questions in relation to display that I can't find answers to:
I have looked at the display > views but can't find which one of the php files controls the product listing view.
Ideally I want to show a listing of the products in a given category as follows:
Product name, product price, quantity available, link to product page button
Thanks!
Type of content = product
Type of layout = list
Display 'Add to cart' button = No
Link to the product page = No
I have two questions in relation to display that I can't find answers to:
- Is there a way to show the stock available in a product list?
- Is it possible to display a link from the product in a list to the product page as a button rather than a hyperlink on the title?For number 2, I can't use the standard "add to cart" button as there are custom fields that need to be filled for each product and the "add to cart" button bypasses these fields. Can't seem to find anyway around this. The table view of the products is not what I want.
I have looked at the display > views but can't find which one of the php files controls the product listing view.
Ideally I want to show a listing of the products in a given category as follows:
Product name, product price, quantity available, link to product page button
Thanks!
Please Log in or Create an account to join the conversation.
13 years 8 months ago #84404
by Xavier
Replied by Xavier on topic Show stock available in a product list
Hi,
You can edit the view "product / listing_list" and change the order of the displayed values to have your wanted order of elements.
You can change the link to the product page into a button, just some html is required.
To add the product quantity, you can add some code like:
You can edit the view "product / listing_list" and change the order of the displayed values to have your wanted order of elements.
You can change the link to the product page into a button, just some html is required.
To add the product quantity, you can add some code like:
Code:
<?php if($this->row->product_quantity != '-1') echo $this->row->product_quantity ?>
Please Log in or Create an account to join the conversation.
13 years 8 months ago #84444
by JIK
Replied by JIK on topic Show stock available in a product list
Thanks Xavier, I had looked at just about every display except that one!
I'm almost there with what I need now, but I need a little help with the button link. I have put this code into listing_list but it breaks the page:
I just want the button to show ONLY if there is stock available.
Thanks heaps.
I'm almost there with what I need now, but I need a little help with the button link. I have put this code into listing_list but it breaks the page:
Code:
<?php if($this->row->product_quantity != '-1') echo JText::_('NO_STOCK'); ?>
<?php if($this->row->product_quantity != '0') <input type="button" onclick="window.location='<?php echo $link; ?>';" class="button" value=" Available "/> ; ?>
I just want the button to show ONLY if there is stock available.
Thanks heaps.
Please Log in or Create an account to join the conversation.
13 years 8 months ago #84446
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Show stock available in a product list
Hi,
Your code fixed (without PHP errors):
Regards,
Your code fixed (without PHP errors):
Code:
<?php if($this->row->product_quantity != '-1') echo JText::_('NO_STOCK'); ?>
<?php if($this->row->product_quantity != '0') echo '<input type="button" onclick="window.location=\''. $link .'\';" class="button" value=" Available "/>'; ?>
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
13 years 8 months ago #84450
by JIK
Replied by JIK on topic Show stock available in a product list
Totally awesome as always! Thanks so much!
Please Log in or Create an account to join the conversation.
Time to create page: 0.228 seconds