Hello,
I'm trying to add a product on cart, with option, type file. I can add products on cart with this code, but my option file doesn't work.
My params variable to add a product is :
$params = array(
'form_key' => $this->formKey->getFormKey(),
'product' => $productId,
'qty' =>1,
'options' => array(
'11'=> array( //11 is the id of my custom option (find it on catalog_product_options table)
'type' => "application/octet-stream",
'quote_path' =>"/upload/".$img_name,
'secret_key' => substr(md5(file_get_contents($_SERVER['DOCUMENT_ROOT']."/upload/".img_name)), 0, 20),
)
)
);When i'm going to the cart, I can see my product, but I have error:
THE PRODUCT HAS REQUIRED OPTIONS.
Does someone have any idea ? Or am I missing something on my $params ?
Thank you