Magento:在一页结账中显示审核步骤

发布于 2024-09-27 07:15:44 字数 74 浏览 4 评论 0原文

我一生都无法弄清楚这一点。我想立即在 Magento 的一页结账上显示订单审核步骤(处理订单之前的最后一步)。有什么建议吗?谢谢大家。

I have not been able to figure this out for the life of me. I wanted to show the order review step(final step before processing the order) right away on the one page checkout in Magento. Any suggestions? Thanks all.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

樱花坊 2024-10-04 07:15:44

如果您查看 onepage.phtml 的底部,您将看到

<?php if($this->getActiveStep()): ?>
   accordion.openSection('opc-<?php echo $this->getActiveStep() ?>');
<?php endif; ?>

哪个调用 Mage_Checkout_Block_Onepage::getActiveStep() 来确定首先显示哪个步骤。您可以通过在主题中创建自己的 onepage.phtml 并将上面的块更改为来覆盖此设置:

   accordion.openSection('opc-review');

但是,仅当本例中的目标元素('opc-review')具有“allow”类时,openSection 函数才会执行" 一旦前面的结账步骤完成,它就会由 Magento 的 AJAX 设置。您可以使用原型手动添加“允许”类,但是一旦您获得要显示的步骤,您将看到它是空的,因为 AJAX 没有根据前面的步骤填充内容,因为前面的步骤还没有填充内容事情还没有发生!

所以...您可以基于 Cart.php 创建一个新块,并使用 $this->getChildHtml('block-id') 和布局 xml 将其插入 onepage.phtml 中。您需要将其作为 li#opc-summary.section allowed 或类似内容插入到 ol#checkoutSteps 中,并将上面的 js 更改为 accordion.openSection('opc-summary');

这是我目前能为您做的最好的事情。哈特哈,
京东

If you look at the bottom of onepage.phtml, you will see

<?php if($this->getActiveStep()): ?>
   accordion.openSection('opc-<?php echo $this->getActiveStep() ?>');
<?php endif; ?>

which calls Mage_Checkout_Block_Onepage::getActiveStep() to determine which step to show first. You can override this by creating your own onepage.phtml in your theme and changing the block above to be:

   accordion.openSection('opc-review');

However, the openSection function only executes if the target element ('opc-review') in this case, has a class of "allow" which is set by Magento's AJAX once the previous checkout steps are completed. You could manually add the "allow" class using prototype, but once you get the step to display, you'll see that it is empty, since the AJAX hasn't populated the content based on the previous steps as the previous steps haven't happened yet!

So... You could create a new block based on Cart.php and insert that into onepage.phtml using $this->getChildHtml('block-id') and the layout xml. You would need to insert it inside the ol#checkoutSteps as an li#opc-summary.section allow or something like that, and make the js change above to be accordion.openSection('opc-summary');

That's the best I can do at the moment for you. HTH,
JD

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文