简体   繁体   中英

Magento soap api add product with custom options value in shopping cart

I am using soap custom api for create and add product in cart. I have some custom options associated with the product. I have to add a product in cart with custom options. I have tried it but it always gives me Error: Please specify the product required option(s). I have implemented below mentioned two codes for this but both are not working. 在此处输入图片说明

$arrProducts = array( array( "product_id" => "26", "qty" => 2, "sku" => "CHEERCARDS-HAPPY BIRTHDAY-MEOW", "quantity" => 2, "bundle_option" => array( "111" => "toemailid@test.com", "112" => "fromemailid@test.com", "110" => "QR Code", "109" => "Simple message", ), ), )

and

$arrProducts = array( array( "product_id" => "26", "qty" => 1, "sku" => "CHEERCARDS-HAPPY BIRTHDAY-MEOW", "quantity" => 1, 'options' => array ( 0 => array( 'key' => 111, 'value' => '1001' ), 1 => array( 'key' => 112, 'value' => '1001' ), 2 => array( 'key' => 110, 'value' => '1001' ), 3 => array( 'key' => 109, 'value' => '1001' ), ), ), )

you don't need to to give product id and sku with quantity and qty. just try this code.

$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" ) ) );

This works for me. I hope it 'll work for you also.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM