prestashop の公式フォーラムで回答が得られなかったので、質問したいと思います。
利用可能な製品の数を表示する代わりに、顧客の在庫状況を知らせるためにいくつかの色のライトを表示したいと思います. 本当は残り3点より「在庫あり」と表示した方がいいと思います。
だから私は を編集し始めました.tpl
が、機能するために何を変更する必要があるのか 本当にわかりません。
だからここに興味のある部分があります:
<!-- availability -->
<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<span id="availability_label">{l s='Availability:'}</span>
<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}</span>
</p>
<p id="availability_date"{if ($product->quantity > 0) OR !$product->available_for_order OR $PS_CATALOG_MODE OR !isset($product->available_date) OR $product->available_date < $smarty.now|date_format:'%Y-%m-%d'} style="display: none;"{/if}>
<span id="availability_date_label">{l s='Availability date:'}</span>
<span id="availability_date_value">{dateFormat date=$product->available_date full=false}</span>
</p>
<!-- number of item in stock -->
その部分を削除して、次のコードを挿入します。
<p>
{if $product->checkQty($this->id) == 0}<span><img src='images/red.gif' title='Produit en rupture de stock'> Produit en rupture de stock</span>{/if}
{if $product->checkQty($this->id) >= 1 AND $product->checkQty($this->id) <=5}<span><img src='images/orange.gif' title='Attention : Dernières quantités disponible'> Attention : Dernières quantités disponible</span>{/if}
{if $product->checkQty($this->id) > 5}<span><img src='images/green.gif' title='Produit en Stock'> Produit en stock</span>{/if}
</p>
しかし、これは偏角を考慮していません。商品の赤緯を変更しても数量は変わりません。どんな種類の助けも大歓迎です。