mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-25 14:46:06 +03:00
properties in products order
This commit is contained in:
parent
bb2896aefe
commit
93b4c0e9d7
@ -114,6 +114,14 @@ class ModelExtensionRetailcrmOrder extends Model {
|
||||
$productOptions = $this->model_catalog_product->getProductOptions($product['product_id']);
|
||||
|
||||
foreach($product['option'] as $option) {
|
||||
if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox') {
|
||||
$properties[] = array(
|
||||
'code' => $option['product_option_value_id'],
|
||||
'name' => $option['name'],
|
||||
'value' => $option['value']
|
||||
);
|
||||
}
|
||||
|
||||
if(!in_array($option['type'], $offerOptions)) continue;
|
||||
foreach($productOptions as $productOption) {
|
||||
if($productOption['product_option_id'] = $option['product_option_id']) {
|
||||
@ -135,7 +143,7 @@ class ModelExtensionRetailcrmOrder extends Model {
|
||||
$offerId = implode('_', $offerId);
|
||||
}
|
||||
|
||||
$order['items'][] = array(
|
||||
$item = array(
|
||||
'offer' => array(
|
||||
'externalId' => !empty($offerId) ? $product['product_id'].'#'.$offerId : $product['product_id']
|
||||
),
|
||||
@ -143,6 +151,10 @@ class ModelExtensionRetailcrmOrder extends Model {
|
||||
'initialPrice' => $product['price'],
|
||||
'quantity' => $product['quantity'],
|
||||
);
|
||||
|
||||
if (isset($properties)) $item['properties'] = $properties;
|
||||
|
||||
$order['items'][] = $item;
|
||||
}
|
||||
|
||||
if (isset($order_data['order_status_id']) && $order_data['order_status_id'] > 0) {
|
||||
@ -237,6 +249,14 @@ class ModelExtensionRetailcrmOrder extends Model {
|
||||
$productOptions = $this->model_catalog_product->getProductOptions($product['product_id']);
|
||||
|
||||
foreach($product['option'] as $option) {
|
||||
if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox') {
|
||||
$properties[] = array(
|
||||
'code' => $option['product_option_value_id'],
|
||||
'name' => $option['name'],
|
||||
'value' => $option['value']
|
||||
);
|
||||
}
|
||||
|
||||
if(!in_array($option['type'], $offerOptions)) continue;
|
||||
foreach($productOptions as $productOption) {
|
||||
if($productOption['product_option_id'] = $option['product_option_id']) {
|
||||
@ -258,7 +278,7 @@ class ModelExtensionRetailcrmOrder extends Model {
|
||||
$offerId = implode('_', $offerId);
|
||||
}
|
||||
|
||||
$order['items'][] = array(
|
||||
$item = array(
|
||||
'offer' => array(
|
||||
'externalId' => !empty($offerId) ? $product['product_id'].'#'.$offerId : $product['product_id']
|
||||
),
|
||||
@ -266,6 +286,10 @@ class ModelExtensionRetailcrmOrder extends Model {
|
||||
'initialPrice' => $product['price'],
|
||||
'quantity' => $product['quantity'],
|
||||
);
|
||||
|
||||
if (isset($properties)) $item['properties'] = $properties;
|
||||
|
||||
$order['items'][] = $item;
|
||||
}
|
||||
|
||||
if (isset($order_data['order_status_id']) && $order_data['order_status_id'] > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user