shipment_type / sparially -sparally onのみバンドル製品ですか?
質問
私は次のコードを持っています:
/** @var $item Mage_Sales_Model_Quote_Item */
if($item->isShipSeparately())) ...
これはチェックしています shipment_type
引用項目のフィールド。
これはできますか shipment_type
これまでになります SHIPMENT_SEPARATELY
バンドル製品が関係していない場合は?
解決
Magentoのデフォルト属性と製品を使用する場合:いいえ
mysql> SELECT `attribute_code`,`apply_to` FROM `catalog_eav_attribute` JOIN `eav_attribute` ON `eav_attribute`.`attribute_id` = `catalog_eav_attribute`.`attribute_id` WHERE `attribute_code` = 'shipment_type';
+----------------+----------+
| attribute_code | apply_to |
+----------------+----------+
| shipment_type | bundle |
+----------------+----------+
1 row in set (0.00 sec)
もちろん、apply_to値を味方にしたり、出荷タイプの値をshipment_separyに設定できる独自の製品タイプを作成することもできます。
または、イベントsales_convert_quote_item_to_order_itemを観察することもできます
$orderItem->setProductOptions(
array_merge(
$orderItem->getProductOptions(),
array(
'shipment_type' => Mage_Catalog_Model_Product_Type_Abstract::SHIPMENT_SEPARATELY
)
)
);
所属していません magento.stackexchange