[TYPO3-commerce] using allArticles=0 and stock-handling

Sven Schumacher sschu at computerteam.de
Wed Sep 22 19:22:26 CEST 2010


Hmmm,

Am 22.09.2010 08:30, schrieb Morten Haggren:
> Hi Sven,
>
> You've run into one of the oldest bugs plauging commerce ;)
>
>
> http://forge.typo3.org/issues/1345
>
> I suggest you browse up on the issue, somewhere in there is the fix we
> are running on our shops ( a hook into enableColumns ).

line 1103 (which is mentioned in the comments) is a comment and in the 
bugtracker is not the original context mentioned, so finding that line 
was a little bit tricky, to add

if (is_object($this->articles[$this->articles_uids[$j]]) && 
($this->articles[$this->articles_uids[$j]] instanceof tx_commerce_article))

before that line. But 1169 contains already the above mentioned line, so 
I think in trunk this is already fixed - or should be there another 
line, where to add that line?

With plugin.tx_commerce_pi1.articles.showWithNoStock=1 it still crashes, 
because the first attribute-combination is out of stock - like mentioned 
in the thread this wasn't fixed so far - how do you handle this bug?
Perhaps there is an error in my extension for the hook you mentioned... 
(I've attached it to this message, so perhaps, you might be so kind and 
take a look on it?).

For generating the select-fields (especially because of the 
disabled="disabled"-feature) there should be the chance to check at that 
place if the article combination is "in stock" and return "outOfStock" 
otherwise (instead of disabled for non existing article-combinations). 
So near line 902 of commerce/lib/class.tx_commerce_product.php:

  $selectMatrix[$kV][$key] = 'disabled';

should be the right point to start otherwise, or do you think, that is 
the wrong way, to solve the problem?

Thanks so far

Sven




More information about the TYPO3-project-commerce mailing list