链接到单页结帐中的特定步骤

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; ?>');

这篇关于链接到单页结帐中的特定步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)