Magento:在一页结账中显示审核步骤
我一生都无法弄清楚这一点。我想立即在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您查看 onepage.phtml 的底部,您将看到
哪个调用
Mage_Checkout_Block_Onepage::getActiveStep()
来确定首先显示哪个步骤。您可以通过在主题中创建自己的 onepage.phtml 并将上面的块更改为来覆盖此设置:但是,仅当本例中的目标元素('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
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: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 theol#checkoutSteps
as anli#opc-summary.section allow
or something like that, and make the js change above to beaccordion.openSection('opc-summary');
That's the best I can do at the moment for you. HTH,
JD