2016-12-30 2 views
0

내가 ccavenue을 통합하고 작동하지 않음) (리디렉션 나는 ccavenue_request_handler_view에 주문 데이터를 전송해야하지만보기는 ... 어떤 이유로보기 CodeIgniter의로드 및 방법 너무

I를로드하지 않습니다되지 무엇이 오류를 일으키는 지 알지 못합니다. 지금은 해당 뷰 파일에 h1 태그 만 표시되었으며 이는 작동하지 않습니다.

//order.php controller 

$grand_total = 0; 
        $order_id = now(); 
        $ccavenue_send_data = array(); 
        if ($cart = $this->cart->contents()) 
        { 
         $cart_item = $this->cart->total_items(); 

       foreach ($cart as $cart_item) 
       { 
        $itemid=$cart_item['id']; 
        $quantity = $cart_item['qty']; 
        $item_price = $cart_item['price']; 

        $total = $item_price*$quantity; 

        $shipping_cost = $this->get_shipping_cost($itemid,$quantity); 
        $pay_amount = $total+$shipping_cost; 

        $grand_total += $pay_amount; 

        if($cart_item > 1) 
        { 
         $order_type="bulk"; 
        } 
        else 
        { 
         $order_type="single"; 
        } 

        $order_data = array(
         'order_id' => $order_id, 
         'email' => $Email, 
         'customer_type' => $customer_type, 
         'payment_id' => $payment_id, 
         'payment_method' => $payment_method, 
         'address_id' => $add_id, 
         'order_type' => $order_type, 
         'order_group' => 0, 
         'order_status' => "processing", 
         'active' => 0, 
         'return_id' => 0, 
         'coupon_id' => $Coupon, 
         'coupon_discount' => $coupon_discount , 
         'total_amount' => $total, 
         'pay_amount' => $pay_amount, 
         'shipping_date' => "2017-12-28 06:12:10", 
         'item_id' => $itemid, 
         'item_quantity' => $quantity, 
         'shipping_charge' => $shipping_cost, 
         'order_modified' => $Contact 
       ); 

        $this->order_model->add_order($order_data); 
       } 

       $ccavenue_send_data = array(
        'tid' => $order_id, 
        'merchant_id' => 'xxxxx', 
        'order_id' => $order_id, 
        'amount' => $grand_total, 
        'currency' => 'INR', 
        'redirect_url' => base_url().'index.php/Order/return_from_ccavenue', 
        'cancel_url' => base_url().'index.php/Order/cancel_from_ccavenue', 
        'language' => 'EN', 
        'billing_name' => $Fname, 
        'billing_address' => $Address1.'&&'.$Address2, 
        'billing_city' => $City, 
        'billing_state' => 'Gujarat', 
        'billing_zip' => $Zip, 
        'billing_country' => 'India', 
        'billing_tel' => $Contact, 
        'billing_email' => $Email, 
        'delivery_name' => $Fname, 
        'delivery_address' => $Address1.'&&'.$Address2, 
        'delivery_city' => $City, 
        'delivery_state' => 'Gujarat', 
        'delivery_zip' => $Zip, 
        'delivery_country' => 'India', 
        'delivery_tel' => $Contact, 
        'promo_code' => $Coupon 
      ); 
       $this->session->set_userdata('ccavenue_send_data',$ccavenue_send_data);    
      } 

      //$data['ccav_request_data'] = $ccavenue_send_data ; 

      // $this->load->view('ccavRequestHandler_view',$data); --> loading view is not working so i tried redirect method by storing data in session which is not working too 

      redirect('Order/ccavenue_request_handler','refresh'); 

      $this->cart->destroy(); 
      redirect('home','refresh'); 

그것이 작동하는 경우가 CodeIgniter의에서

function ccavenue_request_handler() 
    { 
     $data['post_data'] = $this->session->userdata('ccavenue_send_data'); 
     $this->load->view('ccavRequestHandler_view',$data); 
    } 
+0

리디렉션 ('Order/ccavenue_request_handler')을 시도해 볼 수 있습니까? 리디렉션 대신 ('Order/ccavenue_request_handler', 'refresh'); $ this-> cart-> destroy();를 제거하십시오. 리다이렉트 ('home', 'refresh'); –

답변

1

는이 redirect('home','refresh');이 당신 -if 같이해야처럼은 안 수동으로 경로를 리디렉션해야 ... 리디렉션됩니다 어디 base_url 구성 : redirect(base_url()."order/ccavenue_request_handler"); 또는 base_url이 구성되지 않은 경우 redirect('http://yourprojectname/order/ccavenue_request_handler');