我正在使用 prestashop-1.6 中包含的默认主题之一.是否可以在首页的产品框中根据尺寸和颜色显示产品的产品数量值?
最佳答案
参见 this thread on Prestashop.com forum .看起来像其他人问了一个类似的问题,并且能够使用这段代码让它工作:
{*Added quantity in stock*}
<!-- 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>
<!-- number of item in stock -->
{*if ($display_qties == 1 && !$PS_CATALOG_MODE && $product.available_for_order) *}
<p id="pQuantityAvailable"{if $product.quantity <= 0} style="display: none;"{/if}>
<span id="quantityAvailable">{$product.quantity|intval}</span>
<span {if $product.quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='item in stock'}</span>
<span {if $product.quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}</span>
</p>
<!-- Out of stock hook -->
<p id="oosHook"{if $product.quantity > 0} style="display: none;"{/if}>
{$HOOK_PRODUCT_OOS}
</p>
<p class="warning_inline" id="last_quantities"{if ($product.quantity > $last_qties OR $product.quantity <= 0) OR $allow_oosp OR !$product.available_for_order OR $PS_CATALOG_MODE} style="display: none"{/if} >{l s='Warning: Last items in stock!'}</p>
{*End Added quantity in stock*}
在 this other post also on Prestashop.com 中, 有人报告说他们能够使用 this Prestashop module 显示特定于产品尺寸属性的数量. {/如果}
关于php - 如何在 Prestashop 中显示产品数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27810695/