Templates 如何将PrestaShop 1.7签出手风琴步骤转换为步骤进度条?
我对PrestaShop和PHP非常陌生,我被要求将PrestaShop 1.7(经典主题)当前的手风琴检查步骤转换为步骤进度条。我对CSS和JavaScript有一些足够好的概念,但当我看到PrestaShop文件时,我完全不知所措( 下面是一些代码(注释中的内容是我试图添加以创建步骤进度条的内容)。 checkout-process.tpl是一个谜:Templates 如何将PrestaShop 1.7签出手风琴步骤转换为步骤进度条?,templates,progress-bar,prestashop,accordion,checkout,Templates,Progress Bar,Prestashop,Accordion,Checkout,我对PrestaShop和PHP非常陌生,我被要求将PrestaShop 1.7(经典主题)当前的手风琴检查步骤转换为步骤进度条。我对CSS和JavaScript有一些足够好的概念,但当我看到PrestaShop文件时,我完全不知所措( 下面是一些代码(注释中的内容是我试图添加以创建步骤进度条的内容)。 checkout-process.tpl是一个谜: {foreach from=$steps item="step" key="index"} {re
{foreach from=$steps item="step" key="index"}
{render identifier = $step.identifier
position = ($index + 1)
ui = $step.ui
{* steps = $steps *}
}
{/foreach}
然后我得到了checkout-step.tpl:
{block name='step'}
{* <div id="checkout-steps">
<ul id="checkout-steps__bar">
{foreach from=$steps item="step" key="index"}
<li id="{$step.identifier}" class="step-title h3">{$step.title}</li>
{/foreach}
</ul>
</div> *}
<section id="{$identifier}" class="{[
'checkout-step' => true,
'-current' => $step_is_current,
'-reachable' => $step_is_reachable,
'-complete' => $step_is_complete,
'js-current-step' => $step_is_current
]|classnames}">
<h1 class="step-title h3">
<i class="material-icons rtl-no-flip done"></i>
<span class="step-number">{$position}</span>
{$title}
<span class="step-edit text-muted">
<img src="{$urls.img_url}/icn/edit.png" alt="{l s='Update' d='Shop.Theme.Actions'}" class="icn-16" />
{l s='Edit' d='Shop.Theme.Actions'}</span>
</h1>
<div class="content">
{block name='step_content'}DUMMY STEP CONTENT{/block}
</div>
</section>
{/block}
我不认为我做的是对的,但是如果我几乎明白那里发生了什么,我不知道从哪里开始
如果有人得到了一些建议或者更好的(你可以一直梦想)已经尝试了这种修改,我将很高兴获得任何信息、帮助、代码示例!!
提前感谢。我花了一段时间,这可能不是最好的方式,但我通过添加进度条,然后用自定义CSS和JavaScript覆盖默认行为,成功地实现了转换
它有很多代码,我不确定它是否有用,我将它发布在那里,但如果有人想要一些信息或代码,我将很乐意与大家分享!你还有吗?:)
public function render(array $extraParams = array())
{
$scope = $this->smarty->createData(
$this->smarty
);
$params = array(
'steps' => array_map(function (CheckoutStepInterface $step) {
return array(
'identifier' => $step->getIdentifier(),
'ui' => new RenderableProxy($step),
// Add title to steps array
'title' => $step->getTitle(),
);
}, $this->getSteps()),
);
$scope->assign(array_merge($extraParams, $params));
$tpl = $this->smarty->createTemplate(
$this->template,
$scope
);
return $tpl->fetch();
}