请指定产品所需的选项“自定义选项”类型文件
我只有一个自定义选项,即文件类型,我试图通过编程方式将产品添加到购物车,如下所示: $logoSku = 'lg-brnd01'; $productLogo = Mage::getModel('catalog/product')->loadByAttribute('sku',$logoSku); $logoOptions = $productLogo->getOptions(); $opts = Mage::getSingleton('catalog/product_option')->getProductOptionCollection($productLogo); $i =0; $cart = Mage::getModel('checkout/cart'); $cart->init(); $params = array( 'product' => $productLogo->getId(), 'qty' => 1, 'form_key' => Mage::getSingleton('core/session')->getFormKey(), ); foreach ($opts->getData() as $data) { $optionId = $data['option_id']; $image = $paths[0]['name']; $options = array( $optionId => array( 'type' …