1

My product has custom option type file, and I successfully place an order with file attached to my product, I want to do reorder only for custom option type file value, is it possible to copy custom option value from order item to cart item?

my phtml code:

<input id="logo<?=$data['option_id']?>"class="input-logo" name="options_<?=$data['option_id']?>_file" type="file"/>
<input style="display:none;" value="save_new" name="options_<?=$data['option_id']?>_file_action" type="text"/>

my add to cart code:

$params = array(
            'product' => $product->getId(),
            'qty' => 1,
            'form_key' => Mage::getSingleton('core/session')->getFormKey(),
        );

$request = new Varien_Object();
$request->setData($params);
try {
   $cart->addProduct($product->getId(), $request);
   $cart->save();
} catch (Exception $e) {
   Mage::getSingleton('core/session')->addError($e->getMessage());
}
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.