Magento soap api在购物车中添加带有自定义选项价值的产品

时间:2014-10-08 11:39:56

标签: php magento soap

我正在使用soap custom api来创建并在购物车中添加产品。我有一些与产品相关的自定义选项。 我必须在购物车中添加带有自定义选项的产品。我试过了,但它总是给我错误:请指定产品所需的选项。 我已经为此实现了下面提到的两个代码,但两个代码都不起作用。enter image description here

$ arrProducts = array(             阵列(                 " PRODUCT_ID" => " 26&#34 ;,                 "数量" => 2,                 " SKU" => " CHEERCARDS-HAPPY BIRTHDAY-MEOW",                 "量" => 2,                 " bundle_option" =>阵列(                     " 111" => " toemailid@test.com" ;,                     " 112" => " fromemailid@test.com" ;,                     " 110" => " QR码",                     " 109" => "简单的消息",                 )             )         )

$ arrProducts = array(             阵列(                 " PRODUCT_ID" => " 26&#34 ;,                 "数量" => 1,                 " SKU" => " CHEERCARDS-HAPPY BIRTHDAY-MEOW",                 "量" => 1,                 '选项' =>阵列(                     0 =>阵列(                         '键' => 111,                         '值' => ' 1001'                     )                     1 =>阵列(                         '键' => 112,                         '值' => ' 1001'                     )                     2 =>阵列(                         '键' => 110,                         '值' => ' 1001'                     )                     3 =>阵列(                         '键' => 109,                         '值' => ' 1001'                     )                 )             )         )

1 个答案:

答案 0 :(得分:0)

您无需为产品ID和sku提供数量和数量。试试这段代码吧。

$arrProducts = array( array( "product_id" => "26", "qty" => 2, "bundle_option" => array( "111" => "toemailid@test.com", "112" => "fromemailid@test.com", "110" => "QR Code", "109" => "Simple message" ) ) );

这对我有用。我希望它也适合你。

相关问题