mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-25 06:36:06 +03:00
fix compatibility with php 5.4 (#197)
This commit is contained in:
parent
1d9110c364
commit
769f35f379
@ -234,7 +234,7 @@ class ModelExtensionRetailcrmIcml extends Model
|
||||
* Dimensions
|
||||
*/
|
||||
if ((!empty($product['length']) && $product['length'] > 0) &&
|
||||
(!empty($product['width'] && $product['width'] > 0))
|
||||
(!empty($product['width']) && $product['width'] > 0)
|
||||
&& !empty($product['height']))
|
||||
{
|
||||
$lenghtArray = $this->model_localisation_length_class->getLengthClass($product['length_class_id']);
|
||||
|
@ -76,17 +76,20 @@ class RetailcrmOrderConverter {
|
||||
|
||||
public function setDiscount() {
|
||||
$discount = 0;
|
||||
$totalCoupon = $this->getTotal('coupon');
|
||||
$totalReward = $this->getTotal('reward');
|
||||
$totalVoucher = $this->getTotal('voucher');
|
||||
|
||||
if (!empty($this->getTotal('coupon'))) {
|
||||
$discount += abs($this->getTotal('coupon'));
|
||||
if (!empty($totalCoupon)) {
|
||||
$discount += abs($totalCoupon);
|
||||
}
|
||||
|
||||
if (!empty($this->getTotal('reward'))) {
|
||||
$discount += abs($this->getTotal('reward'));
|
||||
if (!empty($totalReward)) {
|
||||
$discount += abs($totalReward);
|
||||
}
|
||||
|
||||
if (!empty($this->getTotal('voucher'))) {
|
||||
$discount += abs($this->getTotal('voucher'));
|
||||
if (!empty($totalVoucher)) {
|
||||
$discount += abs($totalVoucher);
|
||||
}
|
||||
|
||||
if ($discount > 0) {
|
||||
@ -169,8 +172,10 @@ class RetailcrmOrderConverter {
|
||||
$this->data['delivery']['code'] = $delivery_code;
|
||||
}
|
||||
|
||||
if (!empty($this->getTotal('shipping'))) {
|
||||
$this->data['delivery']['cost'] = $this->getTotal('shipping');
|
||||
$totalShipping = $this->getTotal('shipping');
|
||||
|
||||
if (!empty($totalShipping)) {
|
||||
$this->data['delivery']['cost'] = $totalShipping;
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
@ -57,7 +57,7 @@ class Retailcrm {
|
||||
* @return mixed object | boolean
|
||||
*/
|
||||
public function getApiClient($apiUrl = null, $apiKey = null, $apiVersion = null) {
|
||||
if (!$this->registry->has(\RetailcrmProxy::class)) {
|
||||
if (!$this->registry->has('RetailcrmProxy')) {
|
||||
$setting = $this->model_setting_setting->getSetting($this->getModuleTitle());
|
||||
|
||||
if ($apiUrl === null && $apiKey === null) {
|
||||
@ -72,12 +72,12 @@ class Retailcrm {
|
||||
}
|
||||
|
||||
$this->registry->set(
|
||||
\RetailcrmProxy::class,
|
||||
'RetailcrmProxy',
|
||||
new \RetailcrmProxy($apiUrl, $apiKey)
|
||||
);
|
||||
}
|
||||
|
||||
return $this->registry->get(\RetailcrmProxy::class);
|
||||
return $this->registry->get('RetailcrmProxy');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user