Drupal 7 を ubercart 配送で使用しています。私のクライアントは、50ドル以上でない限り、送料を地上見積もりに上げてほしいと思っています. 次に、彼は一律 50 ドルを請求したいと考えています。
50 ドルの定額料金とアップスの見積もりを作成しました。
配送見積もりを使用して配送方法を決定する条件はありません。何か案は?
Drupal 7 を ubercart 配送で使用しています。私のクライアントは、50ドル以上でない限り、送料を地上見積もりに上げてほしいと思っています. 次に、彼は一律 50 ドルを請求したいと考えています。
50 ドルの定額料金とアップスの見積もりを作成しました。
配送見積もりを使用して配送方法を決定する条件はありません。何か案は?
これで分かった。きれいではありませんが、機能します。ups オプションに移動し、php 評価で条件を追加するだけです。条件が機能するには、2 つの支払い方法が利用可能である必要があることに注意してください。このコードを貼り付けます。
$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 などの間で最も安価な方法を自動的に選択することもできます。
ともかく。これが他の誰かに役立つことを願っています。