使用Prestashop 1.7.6 我有一个关于免费送货的问题,众所周知,它始终显示免费(因为在后台运营商中默认选择它),直到在运营商选择步骤中更改为止。
所以我需要指导的是,我想隐藏运费,直到结账时选择“运输方式”。 (或者可能是“在下一步中计算”)
这是 cartpresenter.php 代码,我猜需要修改?
if (isset($deliveryOptionList) && count($deliveryOptionList) > 0) {
foreach ($deliveryOptionList as $option) {
foreach ($option as $currentCarrier) {
if (isset($currentCarrier['is_free']) && $currentCarrier['is_free'] > 0) {
$shippingDisplayValue = $this->translator->trans('Free', [], 'Shop.Theme.Checkout');
break 2;
致以诚挚的问候
您可以创建主题并修改 smarty 模板:
对于购物车
复制到您的主题并修改 /themes/classic/templates/checkout/_partials/cart-detailed-totals.tpl 并在第 31 行插入条件并在第 47 行关闭它:
<div class="card-block">
{foreach from=$cart.subtotals item="subtotal"}
{if $subtotal && $subtotal.value|count_characters > 0 && $subtotal.type !== 'tax'}
{if $subtotal.type === 'shipping' && $subtotal.amount > 0} {* line added *}
<div class="cart-summary-line" id="cart-subtotal-{$subtotal.type}">
<span class="label{if 'products' === $subtotal.type} js-subtotal{/if}">
{if 'products' == $subtotal.type}
{$cart.summary_string}
{else}
{$subtotal.label}
{/if}
</span>
<span class="value">
{if 'discount' == $subtotal.type}- {/if}{$subtotal.value}
</span>
{if $subtotal.type === 'shipping'}
<div><small class="value">{hook h='displayCheckoutSubtotalDetails' subtotal=$subtotal}</small></div>
{/if}
</div>
{/if} {* line added *}
{/if}
{/foreach}
</div>
结帐
只需对文件 /themes/classic/templates/checkout/_partials/cart-summary-subtotals.tpl
执行相同操作祝你好运:)
那么我们知道哪些tpl文件还需要编辑吗?编辑迷你购物车和产品总和肯定会很好。但是,我不知道它们是哪个 tpl 以及如何编辑它们。有谁知道吗