Merge branch 'master' into master

This commit is contained in:
Alex Lushpai 2017-04-07 12:35:06 +03:00 committed by GitHub
commit b84739162c
6 changed files with 16 additions and 5 deletions

View File

@ -54,6 +54,13 @@ class ControllerExtensionModuleRetailcrm extends Controller
'catalog/model/account/customer/addCustomer/after',
'extension/module/retailcrm/customer_create'
);
$this->model_extension_event
->addEvent(
'retailcrm',
'catalog/model/checkout/order/editOrder/after',
'extension/module/retailcrm/order_edit'
);
}
/**
@ -78,6 +85,7 @@ class ControllerExtensionModuleRetailcrm extends Controller
*/
public function index()
{
$this->load->model('localisation/country');
$this->load->model('setting/setting');
$this->load->model('extension/module');

View File

@ -12,7 +12,6 @@ $_['retailcrm_base_settings'] = 'Connection settings';
$_['retailcrm_dict_settings'] = 'Dictionary settings';
$_['retailcrm_countries_settings'] = 'Trading zones setting';
$_['retailcrm_upload_order'] = 'Unload single order';
$_['retailcrm_url'] = 'RetailCRM URL';
$_['retailcrm_apikey'] = 'RetailCRM API Key';
@ -25,7 +24,6 @@ $_['text_success_catalog'] = 'Catalog successfully unloaded';
$_['text_error_order'] = 'Error! Order is not unloaded!';
$_['text_error_order_id'] = 'Error! Enter the correct order number!';
$_['retailcrm_dict_delivery'] = 'Shipment methods';
$_['retailcrm_dict_status'] = 'Order statuses';
$_['retailcrm_dict_payment'] = 'Payment methods';

View File

@ -221,6 +221,7 @@ class ModelExtensionRetailcrmIcml extends Model
}
$e->appendChild($this->dd->createElement('price'))
->appendChild($this->dd->createTextNode($productPrice + $optionsTotalCost));
->appendChild($this->dd->createTextNode($product['price'] + $optionsTotalCost));
/**
* Vendor
*/

View File

@ -1,7 +1,6 @@
<?php
class ModelExtensionRetailcrmOrder extends Model {
public function uploadToCrm($orders) {
$this->load->model('catalog/product');

View File

@ -49,6 +49,7 @@
<label for="retailcrm_apikey"><?php echo $retailcrm_apikey; ?></label><br>
<input id="retailcrm_apikey" type="text" name="retailcrm_apikey" value="<?php if (isset($saved_settings['retailcrm_apikey'])): echo $saved_settings['retailcrm_apikey']; endif;?>">
</div>
<h3><?php echo $retailcrm_countries_settings; ?></h3>
<div class="retailcrm_unit">
<div class="well well-sm" style="height: 150px; overflow: auto; width: 30%;">
@ -78,6 +79,7 @@
<h3><?php echo $retailcrm_dict_settings; ?></h3>
<h4><?php echo $retailcrm_dict_delivery; ?></h4>
<?php foreach($delivery['opencart'] as $value): ?>
<div class="pm"><?php echo $value['title'].':'; ?></div>
@ -202,4 +204,4 @@
$('#export_order').button('reset');
}
});
</script>
</script>

View File

@ -59,11 +59,13 @@ class ModelExtensionRetailcrmOrder extends Model {
if ($totals['code'] == 'shipping') {
$deliveryCost = $totals['value'];
}
if ($totals['code'] == 'coupon') {
$couponTotal = abs($totals['value']);
}
}
}
$order['discount'] = $couponTotal;
$order['createdAt'] = $order_data['date_added'];
@ -209,6 +211,7 @@ class ModelExtensionRetailcrmOrder extends Model {
))
)
);
if(!empty($deliveryCost)){
$order['delivery']['cost'] = $deliveryCost;
}
@ -219,7 +222,7 @@ class ModelExtensionRetailcrmOrder extends Model {
foreach ($orderProducts as $product) {
$offerId = '';
if(!empty($product['option'])) {
if (!empty($product['option'])) {
$options = array();
$productOptions = $this->model_catalog_product->getProductOptions($product['product_id']);