[TYPO3-commerce] (patch) potential attribute dropdowns fix

Morten Olesen mo at idefa.dk
Tue Oct 7 14:35:13 CEST 2008


Hi again,

Seems the reason the above patch worked was that I had a second module 
hooked into
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_product.php']['aditionalWhere']
which added the stock check in get_articles, without this it will still 
show articles which are not in stock regardless of how the typoscript is 
setup.

To get it to work we need to teach 
product->get_Articles_by_AttributeArray to filter 'out of stock' 
articles if the TS dictates it.

Now while

	  	 		if ( 
$GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_commerce_pi1.']['articles.']['showWithNoStock']==0 
){
					$whereStock=." AND tx_comdefaultstock_stock > 0" ;#This is 
inelegant and will only work for com_defaultstock
				}else{$whereStock="";}

works it will only work for com_defaultstock.

So either we need to make a hook in it's place or more elegantly let 
stock modules have a way to define the $whereStock in the above example.

Aye ideas, preferences, etc?

/Morten Olesen



More information about the TYPO3-project-commerce mailing list