Link to a specific step in onepage checkout(链接到单页结帐中的特定步骤)
问题描述
是否可以将浏览器重定向到单页结帐的第 n 步?如果是这样,人们将如何去做?
Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it?
我正在开发一个付款模块,并且有一种取消"操作,我希望将用户返回到您选择付款方式的结帐步骤.
I'm working on a payment module and have a sort of "cancel" action that i would like to return the user to the step in checkout where you choose the payment method.
我目前将用户返回到结帐的第一步,如下所示:
I currently return the user to the first step of the checkout like so:
$this->_redirect('checkout/onepage', array('_secure'=>true));
另一个问题是我不是一直都在工作,在某些浏览器中,我真的不想将这种作品命名为有时".这是众所周知的和/或普遍接受的吗?我对此的实际信息很少,但我收到了客户对这种行为的投诉.他们通常不会给我任何细节,所以这是一个死胡同.
Another issue with this is that i does not work all the time, in certain browsers i'd really not like to name this sort of works "sometimes". Is that something that is known and/or commonly accepted? I have very little actual information regarding this, but i've had complaints from customers about this behaviour. They generally won't give me any specifics so it's kind of a dead end.
推荐答案
checkout/onepage.phtml:
在 PHP 中
$step = Mage::app()->getRequest()->getParam('step');
$stepCodes = array('billing', 'shipping', 'shipping_method', 'payment', 'review');
if (($step) && (in_array($step,$stepCodes)) && ($this->getActiveStep() == 'billing')) {
$checkout = Mage::getSingleton('checkout/type_onepage');
$checkout->saveBilling(Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->toArray(),false);
$checkout->saveShipping(Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->toArray(),false);
$checkout->saveShippingMethod(Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingMethod());
$activestep = Mage::app()->getRequest()->getParam('step');
}
else
if($this->getActiveStep()) {
$activestep = $this->getActiveStep();
}
在 JavaScript 中
accordion.openSection('opc-<?php /* edit */ echo $activestep; ?>');
这篇关于链接到单页结帐中的特定步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:链接到单页结帐中的特定步骤
基础教程推荐
- PHP - 从时差中排除所有非营业时间/天 2022-01-01
- 在 Magento 中设置全局变量,GUI 方式? 2021-01-01
- 使用 jQuery Ajax 删除 mySQL 表行 2021-01-01
- File_get_contents 不起作用? 2021-01-01
- 为 iPhone APNS 使用 PHP 时出错 2022-01-01
- 雄辩的 laravel WhereIn All 2021-01-01
- 使用 php 7 运行 composer,但为 php 5 安装包 2022-01-01
- Laravel Dusk:FacebookWebDriverExceptionUnknownErrorException:未知错误:NET::ERR_CONNECTION_REJECTED 2022-01-01
- PHP中如何获取当前用户的请求参数? 2023-09-25
- PHP 5 反射 API 性能 2021-01-01
