2012-10-16 3 views
0

나는 Drupal 7을 ubercart 배송과 함께 사용하고 있습니다. 내 고객은 배송비가 50 달러 이상인 경우를 제외하고는 배송료를 상계 할 것을 원합니다. 그런 다음 50 달러를 청구하려고합니다.ups 배송 견적을 기반으로 조건부로 ubercart를 설정하려면 어떻게해야합니까?

저는 50 달러의 가격과 높은 가격의 고정 요금을 만들었습니다.

운송 방법을 결정하기 위해 운송 견적을 사용하는 조건이 표시되지 않습니다. 어떤 아이디어?

답변

1

알아 냈습니다. 예쁘지는 않지만 작동합니다. ups 옵션으로 가서 PHP 평가가있는 조건을 추가하십시오. 조건에 따라 두 가지 지불 방법을 사용할 수 있어야합니다. 이 코드를 붙여 넣으십시오.

$method = array (
    'id' => 'ups', 
    'module' => 'uc_ups', 
    'title' => 'UPS', 
    'operations' => array (
    'configure' => array (
     'title' => 'configure', 
     'href' => 'admin/store/settings/quotes/settings/ups', 
    ), 
), 
    'quote' => array (
    'type' => 'small_package', 
    'callback' => 'uc_ups_quote', 
    'accessorials' => array (
     '03' => 'UPS Ground', 
    ), 
), 
    'ship' => array (
    'type' => 'small_package', 
    'callback' => 'uc_ups_fulfill_order', 
    'file' => 'uc_ups.ship.inc', 
    'pkg_types' => array (
     '02' => 'Customer Supplied Package', 
     '01' => 'UPS Letter', 
     '03' => 'Tube', 
     '04' => 'PAK', 
     21 => 'UPS Express Box', 
     24 => 'UPS 25KG Box', 
     25 => 'UPS 10KG Box', 
     30 => 'Pallet', 
     '2a' => 'Small Express Box', 
     '2b' => 'Medium Express Box', 
     '2c' => 'Large Express Box', 
    ), 
), 
    'cancel' => 'uc_ups_void_shipment', 
    'enabled' => 1, 
    'weight' => '0', 
); 

$details->postal_code = $order->delivery_postal_code; 
$details->zone = $order->delivery_zone; 
$details->country = $order->delivery_country; 

$quote = uc_ups_quote($order->products, $details , $method); 
return ($quote['03']['rate'] < 50); 

이 방법은 다른 유형의 운송을 위해 조절할 수 있습니다.이 조건은 지상에만 적용됩니다. ups/fedex와 같은 것 중에서 가장 비싼 방법을 자동으로 선택하도록 수정할 수도 있습니다.

어쨌든. 희망이 다른 사람을 도울 수 있기를 바랍니다.

관련 문제