七宝对美国邮政进行多件收费

时间:2019-06-02 00:00:38

标签: php laravel shippo

我知道在SHIPPO中使用默认的USPS不支持多件套,从而使费率中出现空数组。当客户的购物车中有多个物品时,我们该如何克服?我当时在想每个项目的费率,然后将它们加起来,但是我必须按优先级(快速,优先级,地面等)将它们匹配。

它可以与FedEx和UPS配合使用,但是,如果托运人决定不使用这些公司,则它们将陷入空运费。

$fromAddress = [
            'name' => 'Shawn Ippotle',
            'company' => 'Shippo',
            'street1' => '215 Clayton St.',
            'city' => 'San Francisco',
            'state' => 'CA',
            'zip' => '94117',
            'country' => 'US',
            'phone' => '+1 555 341 9393',
            'email' => 'shippotle@goshippo.com'
        ];

$toAddress = [
            'name' => 'JOHN DOE"',
            'company' => '',
            'street1' => '5802 15th Ave',
            'street2' => '',
            'city' => 'Brooklyn',
            'state' => 'NY',
            'zip' => '11214',
            'country' => 'US',
            'phone' => '+1 718 341 9393',
            'email' => 'test@test.com'
        ];

$parcel = [
            array(
            'length'=> '5',
            'width'=> '5',
            'height'=> '5',
            'distance_unit'=> 'in',
            'weight'=> '2',
            'mass_unit'=> 'lb',
            ),
            array(
                'length'=> '10',
                'width'=> '10',
                'height'=> '10',
                'distance_unit'=> 'in',
                'weight'=> '2',
                'mass_unit'=> 'lb',
            )
        ];

    return Shippo_Shipment::create([
                'object_purpose' => 'QUOTE'
                'address_from' => $from_address,
                'address_to' => $to_address,
                'parcels' => $parcel,
                'async' => false,
            ]);

感谢您提供任何见解或示例。

0 个答案:

没有答案