[TYPO3] tt_products: Products always visible even stock is 0 - SOLUTION

Harald Klotzberg [decomplex audio HQ] harry at decomplexaudio.com
Thu Feb 23 14:09:06 CET 2006

Hi again,

ok, i found a solution which works nice:

first of all $this->conf['showProductsNotInStock'] should changed to
$this->conf['showNotinStock'] in general.

i modified my ITEM_LIST_TEMPLATE with a new marker ###HK_IFPDFONLY### 
i extend class.tx_ttproducts_list_view.php (line 295, before if(
$datasheetFile == '' )   ..) width:

	if ($row['inStock']==0 && $this->conf['showNotinStock'] &&
is_array($TCA[$this->tt_products->table->name]['columns']['inStock']) ) {
marker is now outcomment if stock = 0, means no "add to basket" button is

for the single view the ###ITEM_SINGLE_DISPLAY_NOT_IN_STOCK### in the
template holds the same as single-display, without having button-stuff

now i have 3 different "product views":
- normal product width the possibility of a additional pdf download listed
(solved as datasheet + marker)
- normal products
- pdf products only  (without "to basket button" / Quantity listed)


maybe it´s helpful for someone out there

grtz, harry

-----Original Message-----
From: Harald Klotzberg [decomplex audio HQ]
[mailto:harry at decomplexaudio.com] 
Sent: Thursday, February 23, 2006 11:10 AM
To: 'TYPO3 English'
Subject: RE: [TYPO3] tt_products: Products always visible even stock is 0 -
1/2 Solution

Hi Franz,

another idea, seems quite easier:

There is a part ###ITEM_SINGLE_DISPLAY_NOT_IN_STOCK### in the Template,
having "This item is not on Stock" listed, so the easiest way is to fill 
in the normal Item_List view stuff there, without having "the add to basket"
and price stuff etc....

code in class.tx_ttproducts_single_view.php

} else if ($row['inStock']==0 && $this->conf['showProductsNotInStock'] &&
is_array($TCA[$this->tt_products->table->name]['columns']['inStock']) ) {
	$itemFrameTemplate = '###ITEM_SINGLE_DISPLAY_NOT_IN_STOCK###';
} ...

but it doesn´t work as expected.

this seems uncorrect: $this->conf['showProductsNotInStock']

I search through the whole typo-sourcecode, this is only listed in
While i´m typing this, ich changed it to:

	} else if ($row['inStock']==0 &&
is_array($TCA[$this->tt_products->table->name]['columns']['inStock']) ) {

an now i get a not in stock message !!! cool

so next step is to have same functionality for list_VIEW as well, and
everything is PERFECT :)

grtz, harry

-----Original Message-----
From: typo3-english-bounces at lists.netfielders.de
[mailto:typo3-english-bounces at lists.netfielders.de] On Behalf Of Franz
Sent: Thursday, February 23, 2006 8:43 AM
To: typo3-english at lists.netfielders.de
Subject: Re: [TYPO3] tt_products: Products always visible even stock is 0

Helleo harry,

> i have some troubles with the showNotinStock Option in tt_products.
> Products are always visible, even Stock is 0
This is as intended.

> I thought setting the showNotinStock = 1 should help, so button should 
> be invisible, right ? But nothing happens, products are always shown 
> :(

You can move the button out of the products item display into the list
template. So you have only one button on a page.

See the BananaGuard's template/example_template_bill_de.tmpl.

- Franz
TYPO3-english mailing list
TYPO3-english at lists.netfielders.de

More information about the TYPO3-english mailing list