PHP code example of pifeifei / shunfeng-wms

1. Go to this page and download the library: Download pifeifei/shunfeng-wms library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pifeifei / shunfeng-wms example snippets




use hVenus\SFExpressAPI\BSP\OrderService;

$testEnvPath = __DIR__.'/.env';

if (file_exists($testEnvPath)) {
    $dotenv = Dotenv::createImmutable(dirname($testEnvPath));
    $dotenv->load();
}

$configAll = onfig()->client('companycode'),
    'Items' => [
        'Item' => [[
            'SkuNo' => 'sxmTest000001', // 商品编码
            'ItemName' => '测试鲜食海参6A', // 商品名称
            'Description' => '测试商品描述', // 品牌描述(别名)
            'StandardDescription' => '1斤', // 物品规格描述
            'IsPresent' => 'N', // 是否赠品, Y:是; N:否
            'IsVirtualProduct' => 'N', // 是否虚拟产品, Y:是; N:否
            // 'IsFragile' => 'N', // 是否易碎品: Y:是; N:否
            'ItemClass' => '鲜食海参', // 货品类型
            //        'StorageTemperature' => '5', // 存储温度: 5:零下18度以下
            // 'TransportTemperature' => '5', // 运输温度
        ]],
    ],
]];

$response = $client->getClient()
    ->proxy('http://127.0.0.1:8888')
    ->setData($data)
    ->addDataOptions(['service' => 'ITEM_SERVICE'])
    ->request();
dump($response->toArray());

// 或者
$data = [[
        'SkuNo' => 'sxmTest000001', // 商品编码
        'ItemName' => '测试鲜食海参6A', // 商品名称
        'Description' => '测试商品描述', // 品牌描述(别名)
        'StandardDescription' => '1斤', // 物品规格描述
        'IsPresent' => 'N', // 是否赠品, Y:是; N:否
        'IsVirtualProduct' => 'N', // 是否虚拟产品, Y:是; N:否
        'ItemClass' => '鲜食海参', // 货品类型
    ]];
$response = $client->itemService($data);
dump($response);