如何删除prestashop 1.6.1上的交货装运步骤?
我是prestashop的新手,由于我只销售虚拟产品,因此在删除配送步骤时遇到了重大问题。我正在使用prestashop 1.6.1 我知道我必须修改如何删除prestashop 1.6.1上的交货装运步骤?,prestashop,prestashop-1.6,Prestashop,Prestashop 1.6,我是prestashop的新手,由于我只销售虚拟产品,因此在删除配送步骤时遇到了重大问题。我正在使用prestashop 1.6.1 我知道我必须修改order carrier.tpl文件,并且我在这里和那里关注了好几篇文章,但都做不好 你们中有人对如何做到这一点有什么实际想法吗?在shopping-cart.tpl中,删除对order-carrier.tpl的呼叫。如果您没有在orderController.php中使用单页签出,则必须将所有重定向更改为步骤2(装运方法选择),更改为重定向步骤
order carrier.tpl
文件,并且我在这里和那里关注了好几篇文章,但都做不好
你们中有人对如何做到这一点有什么实际想法吗?在shopping-cart.tpl中,删除对order-carrier.tpl的呼叫。如果您没有在orderController.php中使用单页签出,则必须将所有重定向更改为步骤2(装运方法选择),更改为重定向步骤3 Tools::redirect('index.php?controller=order&step=2');重定向('index.php?controller=order&step=3') 你好,这是我做的
重写AdminOrderPreferencesController,并添加一个布尔配置字段以切换此功能
$this->fields_options = array(
[...]
'PS_ORDER_PROCESS_BYPASS_SHIPPING' => array(
'title' => $this->l('Bypass shipping step'),
'hint' => $this->l('Do not show shipping step in order process.'),
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool'
)
);
您现在可以在Backoffice中的首选项>订单下找到一个切换按钮
覆盖OrderController并在
init()
方法中添加if
,以将当前步骤设置为付款步骤,前提是控制器在交付步骤中初始化自身
另外,在initContent()
方法中,绕过支付步骤上的CGV检查验证。
如果你不这样做,CGV将永远不会被检查,它将在交付步骤重定向你,你将告诉他,他实际上是在付款步骤,他将再次检查CGV,他将做同样的重定向。。。你处于一个无限循环中
case OrderController::STEP_PAYMENT:
$cgv = Tools::getValue('cgv') || $this->context->cookie->check_cgv;
if (
!(bool)Configuration::get('PS_ORDER_PROCESS_BYPASS_SHIPPING') && // HERE IT IS
$is_advanced_payment_api === false && Configuration::get('PS_CONDITIONS')
&& (!Validate::isBool($cgv) || $cgv == false)
) {
Tools::redirect('index.php?controller=order&step=2');
}
将配置参数传递给视图以修改显示
$this->context->smarty->assign('bypass_shipping_step', (bool)Configuration::get('PS_ORDER_PROCESS_BYPASS_SHIPPING'));
在您看来,您是否使用一些if
在订单步骤.tpl中,您可以在第四个
li
的周围添加{if not$passport\u shipping\u step}…{/if}
来隐藏它,并执行类似以下操作:
{if $bypass_shipping_step}
<style>
ul.step li{
width:25%;
}
</style>
{/if}
{if$bypass\u shipping\u step}
ul.stepli{
宽度:25%;
}
{/if}
或者导入一个更干净的专用样式表。
希望有帮助。谢谢你的帮助。这真的很有帮助。对于那些询问smarty assign应该放在哪里的人,我将它放在OrderController.php中init()方法的末尾
{if $bypass_shipping_step}
<style>
ul.step li{
width:25%;
}
</style>
{/if}