Skip to content

Commit

Permalink
Merge pull request #98 from magmodules/1.4.19
Browse files Browse the repository at this point in the history
1.4.19
  • Loading branch information
Marvin-Magmodules authored Aug 5, 2020
2 parents a9ec401 + a9218c1 commit a1f9ee2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
8 changes: 8 additions & 0 deletions Helper/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@ public function validateJsonData($orderData, $request)
}
}

if (!empty($data['price']['currency'])) {
$currencyCodes = $this->storeManager->getStore($storeId)->getAvailableCurrencyCodes();
if (!in_array($data['price']['currency'], $currencyCodes)) {
$msg = __('"%1" not in available currencies for this store', $data['price']['currency']);
return $this->jsonResponse($msg);
}
}

return $data;
}

Expand Down
5 changes: 4 additions & 1 deletion Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ public function importOrder($data, $storeId)
$this->checkoutSession->setForceBackorder($this->config->getEnableBackorders());

$store = $this->storeManager->getStore($storeId);
$store->setCurrentCurrencyCode($data['price']['currency']);

$cartId = $this->cartManagementInterface->createEmptyCart();
$cart = $this->cartRepositoryInterface->get($cartId)->setStore($store)->setCurrency()->setIsSuperMode(true);
$customerId = $this->setCustomerCart($cart, $store, $data);
Expand Down Expand Up @@ -315,7 +317,8 @@ public function importOrder($data, $storeId)
}

$orderId = $this->cartManagementInterface->placeOrder($cart->getId());

$store->setCurrentCurrencyCode($store->getBaseCurrencyCode());

/** @var \Magento\Sales\Model\Order $order */
$order = $this->orderRepository->get($orderId);
if ($this->orderHelper->getUseChannelOrderId($storeId)) {
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ Step-by-step to install the Magento® 2 extension through Composer:
```
composer require magmodules/magento2-channable
```
4. After that run the Magento® upgrade and clean the caches:
4. Once completed run the Magento® module enable command:
```
bin/magento module:enable Magmodules_Channable
```
5. After that run the Magento® upgrade and clean the caches:
```
php bin/magento setup:upgrade
php bin/magento cache:flush
```
5. If Magento® is running in production mode you also need to redeploy the static content:
6. If Magento® is running in production mode you also need to redeploy the static content:
```
php bin/magento setup:static-content:deploy
```
6. After the installation: Go to your Magento® admin portal and open ‘Stores’ > ‘Configuration’ > ‘Magmodules’ > ‘Channable’.
7. After the installation: Go to your Magento® admin portal and open ‘Stores’ > ‘Configuration’ > ‘Magmodules’ > ‘Channable’.

### Installation using the [Magento® Marketplace](https://marketplace.magento.com/magmodules-magento2-channable.html) ###
Get your authentication keys
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magmodules/magento2-channable",
"description": "Channable integration for Magento 2",
"type": "magento2-module",
"version": "1.4.18",
"version": "1.4.19",
"license": "BSD-2-Clause",
"homepage": "https://github.com/magmodules/magento2-channable",
"require": {
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magmodules_Channable" setup_version="1.4.18"/>
<module name="Magmodules_Channable" setup_version="1.4.19"/>
</config>

0 comments on commit a1f9ee2

Please sign in to comment.