I am realising that this may be trickier than thought ....
I am looking at product_listing.php and I see this:
// product is in stock or customers may add it to cart anyway
($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
$how_many++;
}
// hide quantity box
And I think that this is the starting point for what I would like to do. I need some code that will check the 'products_quantity' field in the database and if this is a value less than 1 to show a message under the price.
So over at tpl_product_info_display.php I have .........
Code:
<!--bof Product Price block -->
<h2 id="productPrices" class="productGeneral">
<?php
// base price
if ($show_onetime_charges_description == 'true') {
$one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
} else {
$one_time = '';
}
echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
?><font color="#000066"> Delivered</font></h2>
<!--eof Product Price block -->
The last line with delivered is something I added into all products descriptions as we offer free shipping.
Could anyone please point me in the direction of what code I would need to slap in under here that will check the database for stock levels and then display the relevant message ????
I am thinking something like .....
if ($listing->fields['products_quantity'] < 1 echo DEFINED_TEXT
I know that is nowhere near complete but still ;)
Bookmarks