2013-01-04 2 views
1

게스트 사용자가 이미 주소를 추가 한 경우 1 단계 (체크 아웃 방법 선택)에서 배송 방법 단계로 이동해야합니다. saveCheckoutMethod 메서드에서 재정의 된 클래스 Mage_Checkout_Model_Type_Onepage에서 다음 코드를 시도했습니다. 하지만이 방법이 작동하지 않는 경우 손님이 Billing Address 단계로 이동하지만 'Setting step shipping_method'메시지가 표시됩니다. Magento 로그에 인쇄됩니다. 배송 방법 단계로 직접 이동하여 두 주소 단계를 프로그래밍 방식으로 건너 뛸 수있는 방법이 있습니까?Magento는 체크 아웃에서 두 단계 건너 뛰기

는 당신은 Mage_Checkout_OnepageController::saveBillingAction() 방법에서 좀 걸릴 수 있습니다
+0

이동 http://stackoverflow.com (는 배송 주소 단계 생략)/questions/1718293/link-to-a-specific-step-in-onepage-checkout을 사용하십시오. 체크 아웃 단계를 유지하려면 쿠키를 사용하십시오. –

답변

1

, 당신은 또 다른 단계로 이동할 수있는 방법을 예를 들어이

public function saveCheckoutMethod($method) 
{ 
    if (empty($method)) { 
     return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); 
    } 

    $this->getQuote()->setCheckoutMethod($method)->save(); 

    $quote = $this->getQuote(); 
    if($quote->getBillingAddress()->validate() && $quote->getShippingAddress()->validate()) 
    {   
     $this->getCheckout() 
      ->setStepData('billing', 'complete', false) 
      ->setStepData('shipping', 'complete', false) 
      ->setStepData('shipping_method', 'allow', true); 
     Mage::log("Setting step shipping_method."); 
    } 
    else 
    { 
     $this->getCheckout()->setStepData('billing', 'allow', true); 
    } 

    return array(); 
} 
이와

} elseif (isset($data['use_for_shipping']) && $data['use_for_shipping'] == 1) { 
    // Here you can specify step name 
    $result['goto_section'] = 'shipping_method'; 

    $result['update_section'] = array(
     'name' => 'shipping-method', 
     'html' => $this->_getShippingMethodsHtml() 
    ); 

    $result['allow_sections'] = array('shipping'); 
    $result['duplicateBillingInfo'] = 'true'; 
+0

그 방법을 시도했지만 Mage_Checkout_OnepageController :: saveMethodAction() 메서드에서 작동하지 않는 것으로 보입니다. 메서드를 전달하는 대신 다음 단계 (청구 지 주소)로 이동합니다. 나는 오버 라이딩 컨트롤러가 실제로 오버 라이팅 컨트롤러에 로깅 라인을 추가하여 실행되는지 확인했다. – newbie