[TYPO3-commerce] show values of a single select attribute

Rolf Nakielski rolf at nakielski.de
Mon May 26 13:29:32 CEST 2008



   Hello list,

   My commerce shop is growing and does already work pretty well. But  
at one point I had to change the code to get the results I needed.

   I have products with one select attribute that can have 3 different  
values. In fact we sell pictures and they are all available as  
postcards and some of them as a small or big poster as well. The  
marker group SELECT_ATTRIBUTES does not show the attribute value for a  
product that has got only one artikel - but I need to have the value  
(Postcard) to be printed close to the price in the product list. I  
changed in the code of "class.tx_commerce_pi1.php" in function  
"makeArticleView()" about 50 lines after the  function header

   from:  if($count > 1) {    to:  if($count > 0) {.

   This seems to work well - the value is printed even if there is  
just one artikel for a product. I could not determine any typoscript  
to get this result nor a hook to do this without a code change. Is  
there a better way to do this? I can imagine that for a lot of shops a  
single attibute value does not make sense to display - but maybe it  
would be an idea to make a typo script setting like  
'display-single-attribute-value = 1' to get it done without code change.

   BTW: is anybody interested in a small extention that realises a  
"minimum sale" (Mindestumsatz). I did one that overrides the link to  
the checkout in the basket with a message if a given sales value is  
not reached. I may share it.

   R o l f   N a k i e l s k i


More information about the TYPO3-project-commerce mailing list