[TYPO3-commerce] using allArticles=0 and stock-handling
Sven Schumacher
sschu at computerteam.de
Tue Sep 21 18:03:10 CEST 2010
Hello,
is there any switch or simple way to get dropdowns (like allArticles=0
provides) but without nostock-articles?
I have very large attributes-list (3 attributes, each of them have lots
of values), and I would like to hide non existing attribute-combinations
of articles (at the moment they are greyed and not selectable) and
articles out of stock (displayed like normal ones, only after selecting
and adding to basket I get the information, that they are out of stock,
which is of course not very customerfriendly.
For example:
First article attribute might be: color (values: dark, green, blue, red,
violet, orange, yellow, pink, brown, black)
next one might be: size (values: 120, 124, 126, 130, 140, 154, 168, 176,
XS, S, M, L, XL)
and the last one might be: logo (values: horse, cat, dog, bear, fish)
so, if a yellow shirt in size 126 with a horse isn't in stock, it
shouldn't be selectable, and even better: not shown.
Using something like:
plugin.tx_commerce_pi1.products.showWithNoStock=0
plugin.tx_commerce_pi1.articles.showWithNoStock=0
produces a white page without any output, so of course an php-error.
After taking a look at category_product.tpl, I found:
<br />
<br />
<h3>SELECTOR_ATTRIBUTES_DROPDOWN</h3>
<em></em>
<br />
<!-- ###SELECTOR_ATTRIBUTES_DROPDOWN### begin-->
<table class="com-select-attributes" cellspacing="0" cellpadding="0"
border="0">
<tr class="com-select-row">
<td>###SELECT_ATTRIBUTES_TITLE###</td>
<td>
<select onchange="###SELECT_ATTRIBUTES_ON_CHANGE###"
name="###SELECT_ATTRIBUTES_HTML_ELEMENT_NAME###">
<!-- ###SELECTOR_ATTRIBUTES_DROPDOWN_ITEM### begin-->
<option value="###SELECT_ATTRIBUTES_VALUE_VALUE###"
###SELECT_ATTRIBUTES_VALUE_STATUS###>
###SELECT_ATTRIBUTES_VALUE_NAME###
</option>
<!-- ###SELECTOR_ATTRIBUTES_DROPDOWN_ITEM### end-->
</select>
###SELECT_ATTRIBUTES_UNIT###
</td>
</tr>
</table>
<!-- ###SELECTOR_ATTRIBUTES_DROPDOWN### end -->
There is no "NO_STOCK" option, like for allArticles=1, so is there any
hook, to change the behavior of parsing and adding items of the subpart:
<!-- ###SELECTOR_ATTRIBUTES_DROPDOWN_ITEM### begin-->
???
Doing it the same way like for allArticles=1 AND the subpart
<!-- ###ARTICLE_VIEW### -->
and
<!-- ###ARTICLE_VIEW_NOSTOCK### -->
should work at this point, too, I think. So I will give it a try, and if
successful provide a patch as diff for the current svn.
More information about the TYPO3-project-commerce
mailing list