php - 如何在 Prestashop 中显示产品数量

标签 php prestashop 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/

相关文章:

php - 如何将 excel 文件从 &lt;input type ="file"> 上传到 php 服务器

Prestashop 过滤器 date_add 在 web 服务中

javascript - Prestablog - Uncaught ReferenceError : tinyMCE is not defined

php - 使用 API 将图像上传到 facebook 粉丝页面

php - Laravel - SQLSTATE[HY001] 无法分配足够的内存 - MsSQL

PHP MongoDB 删除文档并返回

PrestaShop 1.7 不允许禁用该模块

javascript - Prestashop 1.6 superfish 菜单悬停点击

prestashop - 在 Prestashop 1.5.3 中创建自定义页面

mysql - Prestashop ps_product_lang 表,如何将数据从 lan 2 复制到 lang 1 缺少条目