2017-10-20 4 views
0

に別の送料を挿入する方法、私はgetOrderShippingCostに送信しようとしています。しかし、私のカートはfree私のコントローラでprestashopキャリアモジュールの開発

Controller.phpの出荷を示す

$cost_val=120; //this value can be change 

include_once(_PS_MODULE_DIR_.'delivery_scheduler/delivery_scheduler.php'); 

    $DeliveryWeekSched=new delivery_scheduler(); 

    $DeliveryWeekSched->getOrderShippingCost($cost_val,$cost_val); 

delivery_scheduler.php

public function getOrderShippingCost($params, $shipping_cost) 
    { 
     if (Context::getContext()->customer->logged == true) 
     { 
      $id_address_delivery = Context::getContext()->cart->id_address_delivery; 
      $address = new Address($id_address_delivery); 
      return 100; // i want to return `$shipping_cost` 
     } 
     return $shipping_cost; 
    } 

カートに復帰$shipping_cost出荷値はfree .when 100リターンカート出荷値を示します100を表示しています。それは何ですか?私のvを返す方法アウエー?

答えて

0

あなたは、税金や手数料などの追加料金をゼロに設定し、「無料ではない」と設定することでこれを解決できます。

関連する問題