last day (14 days later) » 

12:04 PM
0
A: Magento soap api add product with custom options value in shopping cart

Lokesh Jainyou 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 also work for me if I don't have custom options set with my product. But when I add any custom option with the product and try to add product using magento cart api then it gives me "Error: Please specify the product required option(s).".
 
only product_id and qty required.
what custom options you want to set?
 
But my client added a custom options with required validations that's why I must need to send option values along with the product_id and qty. But I am not able to get the proper post structure for add product with custom option using "cart_product.add" method.
Manage product -> select any product from list -> Custom Options -> add new option -> select inputType as field and keep it mandatory. then try to add product using cart_product.add in magento soap api.
 
i don't think , you can add custom options with product when you are adding product in cart so first add custom option in product then add the product in cart.
 
12:05 PM
hi
could you tell me what do u want exactly?
 
I have added a product from magento back end with two custom options, 1 for receiver email and 1 for message
when I add a product in cart from front end
then it will ask me to send this product ref to any other person (using) with a message
this is the current flow of frontend website
but now I am implementing this on mobile app using
magento soap api for cart checkout
using this
 
did u get any error message?
 
but when I add a product in shopping cart without these 2 custom option value then it return me ==> Error: Please specify the product required option(s).
$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",
),
),
)
$resultCartProductAdd = $client->call($sess_id, "cart_product.add", array($shoppingCartId, $arrProducts));
shoppingCartId already created before this step
 
ok neeraj
give me 2 min.
let me check
 
ok
thanks
:)
"111" => "toemailid@test.com",
"112" => "fromemailid@test.com",
"110" => "QR Code",
"109" => "Simple message",
these are my 4 custom options with a product
 
1:08 PM
hey neeraj, i searched and tried to resolve your problem but i could'nt find the solution but i can give you some useful link.
http://stackoverflow.com/questions/19899127/setting-custom-options-while-adding-a-product-to-cart-via-soap-in-magento/19925338#19925338

http://stackoverflow.com/questions/8960692/how-do-i-create-a-product-with-additional-attributes-in-magento-via-soap-java/8963453#8963453
Please tell me also if you find the solution.
 

last day (14 days later) »