Page 1 of 1

Display Product Option Stock Levels in the Option Dropdown

Posted: Mon Feb 14, 2011 3:33 am
by fgrace
Hi

On the product description page, i wish to display the quantity per individual options.
E.g. If the product eg. dress has a stock level of 6 - this is broken down into sizes eg. 2 Large, 2 Medium & 2 Small

On the front-end the Size option dropdown should display the [option name] and [option quantity in stock] in the dropdown menu as outlined here:

[Options: Size]
||Large - In Stock(2)||
||Medium - In Stock(2)||
||Small - In Stock(2)||

I think the file I need to changes is:
catalog/view/theme/default/template/product/product.tpl

I would be really grateful for some help on this.
thanks
FG :)

Re: Display Product Option Stock Levels in the Option Dropdo

Posted: Mon Feb 14, 2011 3:58 am
by Qphoria
1. EDIT: catalog/controller/product/product.php

2. FIND:

Code: Select all

'name'            => $option_value['name'],
3. AFTER, ADD:

Code: Select all

'quantity'        => $option_value['quantity'],
4. EDIT: catalog/view/theme/YOURTHEME/product/product.tpl

5. FIND:

Code: Select all

<?php echo $option_value['name']; ?>
6. AFTER ADD:

Code: Select all

<?php echo $option_value['quantity']; ?>

Re: Display Product Option Stock Levels in the Option Dropdo

Posted: Thu Feb 17, 2011 6:30 am
by fgrace
Hi Qphoria

Sorry for the delay, many thanks for your help! :)

Re: Display Product Option Stock Levels in the Option Dropdo

Posted: Mon May 09, 2011 6:16 pm
by jrofarrell
Hello,

I am trying to implement this in v1.4.9.3 but unfortunately I am receiving;

Undefined index: quantity in XX\catalog\controller\product\product.php on line 256 < the new line added was 'quantity' => $option_value['quantity']

Any help would be much appreciated.

Regards
James

Re: Display Product Option Stock Levels in the Option Dropdo

Posted: Thu Sep 22, 2011 8:54 pm
by Felias
I'm not getting an error, but the stock level is not displayed. Would surely like to get this working, as it is a real fuzz without it.