From b7e4216cd56c4014a8c75d189d2b24a6f19062bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tjitse=20Efd=C3=A9?= Date: Fri, 8 Feb 2019 11:27:12 +0100 Subject: [PATCH 1/5] Remove comments from files, add strict_types=1 --- .gitignore | 4 +++- Controller/Cart/Sync.php | 7 +------ Observer/SuccessObserver.php | 7 +------ Service/Sync.php | 10 ++-------- Service/SyncInterface.php | 7 +------ Service/SyncLoggerFactory.php | 9 +-------- etc/acl.xml | 13 +++---------- etc/adminhtml/system.xml | 10 +--------- etc/di.xml | 14 ++++---------- etc/events.xml | 15 ++++----------- etc/frontend/routes.xml | 12 +++--------- etc/module.xml | 11 ++--------- 12 files changed, 26 insertions(+), 93 deletions(-) diff --git a/.gitignore b/.gitignore index bc8a670..de6bbb6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -.idea/* \ No newline at end of file +.php_cs.cache +.idea/* +*~ \ No newline at end of file diff --git a/Controller/Cart/Sync.php b/Controller/Cart/Sync.php index ab38702..ff4f42f 100644 --- a/Controller/Cart/Sync.php +++ b/Controller/Cart/Sync.php @@ -1,10 +1,5 @@ - * @copyright 2018 Divante Sp. z o.o. - * @license See LICENSE_DIVANTE.txt for license details. - */ +declare(strict_types=1); namespace Divante\CartSync\Controller\Cart; diff --git a/Observer/SuccessObserver.php b/Observer/SuccessObserver.php index 0a05e76..d14d581 100644 --- a/Observer/SuccessObserver.php +++ b/Observer/SuccessObserver.php @@ -1,10 +1,5 @@ - * @copyright 2018 Divante Sp. z o.o. - * @license See LICENSE_DIVANTE.txt for license details. - */ +declare(strict_types=1); namespace Divante\CartSync\Observer; diff --git a/Service/Sync.php b/Service/Sync.php index 95c6baa..3cda587 100644 --- a/Service/Sync.php +++ b/Service/Sync.php @@ -1,10 +1,5 @@ - * @copyright 2018 Divante Sp. z o.o. - * @license See LICENSE_DIVANTE.txt for license details. - */ +declare(strict_types=1); namespace Divante\CartSync\Service; @@ -82,8 +77,7 @@ public function __construct( QuoteIdMaskFactory $quoteIdMaskFactory, QuoteFactory $quoteFactory, QuoteRepository $quoteRepository - ) - { + ) { $this->cartRepository = $cartRepository; $this->checkoutSession = $checkoutSession; $this->customerRepository = $customerRepository; diff --git a/Service/SyncInterface.php b/Service/SyncInterface.php index 8ab921b..3e693d7 100644 --- a/Service/SyncInterface.php +++ b/Service/SyncInterface.php @@ -1,10 +1,5 @@ - * @copyright 2018 Divante Sp. z o.o. - * @license See LICENSE_DIVANTE.txt for license details. - */ +declare(strict_types=1); namespace Divante\CartSync\Service; diff --git a/Service/SyncLoggerFactory.php b/Service/SyncLoggerFactory.php index 03aa6c6..52430f3 100644 --- a/Service/SyncLoggerFactory.php +++ b/Service/SyncLoggerFactory.php @@ -1,10 +1,5 @@ - * @copyright 2018 Divante Sp. z o.o. - * @license See LICENSE_DIVANTE.txt for license details. - */ +declare(strict_types=1); namespace Divante\CartSync\Service; @@ -24,9 +19,7 @@ class SyncLoggerFactory /** * @param string $channelName - * * @return Logger - * * @throws \Exception */ public function create(string $channelName = 'cart-sync'): Logger diff --git a/etc/acl.xml b/etc/acl.xml index 7697b58..fa76b1d 100644 --- a/etc/acl.xml +++ b/etc/acl.xml @@ -1,17 +1,10 @@ - - + - + diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index d861aa3..75c3ed2 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -1,12 +1,4 @@ - @@ -37,4 +29,4 @@ - \ No newline at end of file + diff --git a/etc/di.xml b/etc/di.xml index 16ef85a..d109f01 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -1,11 +1,5 @@ - - + + - \ No newline at end of file + diff --git a/etc/events.xml b/etc/events.xml index b2ef1ab..10c24da 100644 --- a/etc/events.xml +++ b/etc/events.xml @@ -1,14 +1,7 @@ - - + - + - \ No newline at end of file + diff --git a/etc/frontend/routes.xml b/etc/frontend/routes.xml index 02399d9..9f10ea2 100644 --- a/etc/frontend/routes.xml +++ b/etc/frontend/routes.xml @@ -1,12 +1,6 @@ - - + + diff --git a/etc/module.xml b/etc/module.xml index cb729e6..55cd0ae 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,12 +1,5 @@ - - + From 2c138009f6a8141280f3d6cb108f1821cb34939d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tjitse=20Efd=C3=A9?= Date: Fri, 8 Feb 2019 11:34:34 +0100 Subject: [PATCH 2/5] Rename package to VueStorefront/CartSync --- Controller/Cart/Sync.php | 8 ++++---- Model/Config.php | 2 +- Observer/SuccessObserver.php | 6 +++--- README.md | 2 +- Service/Sync.php | 2 +- Service/SyncInterface.php | 2 +- Service/SyncLoggerFactory.php | 2 +- composer.json | 30 +++++++++++++----------------- etc/acl.xml | 2 +- etc/adminhtml/system.xml | 2 +- etc/di.xml | 2 +- etc/events.xml | 2 +- etc/frontend/routes.xml | 2 +- etc/module.xml | 2 +- 14 files changed, 31 insertions(+), 35 deletions(-) diff --git a/Controller/Cart/Sync.php b/Controller/Cart/Sync.php index ff4f42f..9ac4d44 100644 --- a/Controller/Cart/Sync.php +++ b/Controller/Cart/Sync.php @@ -1,11 +1,11 @@ Go to chechkout**. Yo ## Installation guide 0. Integrate Your Magento2 instance with Vue Storefront: [tutorial](https://medium.com/@piotrkarwatka/vue-storefront-cart-totals-orders-integration-with-magento2-6fbe6860fcd), [video tutorial](https://www.youtube.com/watch?v=CtDXddsyxvM) -1. Copy the module files from the repo to `app/code/Divante/CartSync` +1. Copy the module files from the repo to `app/code/VueStorefront/CartSync` 3. Run `php bin/magento setup:upgrade` 4. Please install the [`vsf-external-checkout`](https://github.com/filrak/vsf-external-checkout) module for Vue Storefront. [See the instruction](https://github.com/filrak/vsf-external-checkout). 5. Go to: Stores -> Configuration | VueStorefront -> External Checkout and set URL diff --git a/Service/Sync.php b/Service/Sync.php index 3cda587..c6acc9c 100644 --- a/Service/Sync.php +++ b/Service/Sync.php @@ -1,7 +1,7 @@ - + diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 75c3ed2..9ce66dc 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -9,7 +9,7 @@ showInWebsite="1" showInStore="1"> vuestorefront_config - Divante_CartSync::configuration + VueStorefront_CartSync::configuration diff --git a/etc/di.xml b/etc/di.xml index d109f01..bb8b142 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -1,5 +1,5 @@ - + diff --git a/etc/events.xml b/etc/events.xml index 10c24da..89ad1ed 100644 --- a/etc/events.xml +++ b/etc/events.xml @@ -2,6 +2,6 @@ - + diff --git a/etc/frontend/routes.xml b/etc/frontend/routes.xml index 9f10ea2..3f3cc98 100644 --- a/etc/frontend/routes.xml +++ b/etc/frontend/routes.xml @@ -3,7 +3,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> - + diff --git a/etc/module.xml b/etc/module.xml index 55cd0ae..3dada24 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,5 +1,5 @@ - + From 5a49dfe6e9294b91ac50d909bcf08cdad96bedcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tjitse=20Efd=C3=A9?= Date: Fri, 8 Feb 2019 11:41:29 +0100 Subject: [PATCH 3/5] Update licence --- LICENSE | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index 475e9db..77387bb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,21 @@ -Copyright (c) 2018 Divante Sp. z o.o. http://divante.co -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +MIT License + +Copyright (c) 2018 Divante Ltd. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 28e7db9c2188ec13259debea1bc5aa102e737d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tjitse=20Efd=C3=A9?= Date: Fri, 8 Feb 2019 13:21:32 +0100 Subject: [PATCH 4/5] Update README --- README.md | 20 ++++++++++++-------- registration.php | 9 +-------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index b714430..d3db344 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,25 @@ This Magento extension allow You to merge given shopping cart with current's user session. It performs a auto-login if user-token provided. -This module is designed to work with: [Vue Storefront External Checkout](https://github.com/filrak/vsf-external-checkout). +This module is designed to work with: [Vue Storefront External Checkout](https://github.com/Vendic/vsf-external-checkout). This extension allows the user to start the session within the Vue Storefront shop and finalize the order in Magento2. It's great when You have very extended/customized Magento checkout which will be hard to port to Vue Storefront. -![External checkout for Vue Storefront](https://github.com/filrak/vsf-external-checkout/raw/master/diagram.png) +![External checkout for Vue Storefront](https://raw.githubusercontent.com/Vendic/vsf-external-checkout/master/media/diagram.png) -## Demo +### Demo You can check this extension in action on: https://demo-magento-checkout.vuestorefront.io -Please add some items to the cart and then go to **Cart -> Go to chechkout**. You will be redirected to the [Magento2 instance](http://demo-magento2.vuestorefront.io/) synchronized with the [Vue Storefront instance](demo-magento-checkout.vuestorefront.io). Shopping carts, logged in user, totals, item prices - should be alligned. +Please add some items to the cart and then go to **Cart -> Go to checkout**. You will be redirected to the [Magento2 instance](http://demo-magento2.vuestorefront.io/) synchronized with the [Vue Storefront instance](demo-magento-checkout.vuestorefront.io). Shopping carts, logged in user, totals, item prices - should be synchronized with Magento 2. +### Prerequisites (the Vue Storefront part) +1. Integrate Your Magento2 instance with Vue Storefront: [tutorial](https://medium.com/@piotrkarwatka/vue-storefront-cart-totals-orders-integration-with-magento2-6fbe6860fcd), [video tutorial](https://www.youtube.com/watch?v=CtDXddsyxvM) +2. Install [Vue Storefront External Checkout](https://github.com/Vendic/vsf-external-checkout) on your Vue Storefront instance -## Installation guide - -0. Integrate Your Magento2 instance with Vue Storefront: [tutorial](https://medium.com/@piotrkarwatka/vue-storefront-cart-totals-orders-integration-with-magento2-6fbe6860fcd), [video tutorial](https://www.youtube.com/watch?v=CtDXddsyxvM) -1. Copy the module files from the repo to `app/code/VueStorefront/CartSync` +### Installation guide (the Magento 2 part) +1. Install the module with composer: +```bash +composer require vuestorefront/magento2-vue-cart-sync +``` 3. Run `php bin/magento setup:upgrade` 4. Please install the [`vsf-external-checkout`](https://github.com/filrak/vsf-external-checkout) module for Vue Storefront. [See the instruction](https://github.com/filrak/vsf-external-checkout). 5. Go to: Stores -> Configuration | VueStorefront -> External Checkout and set URL diff --git a/registration.php b/registration.php index 55212b6..5c83e78 100755 --- a/registration.php +++ b/registration.php @@ -1,13 +1,6 @@ Date: Fri, 8 Feb 2019 13:28:45 +0100 Subject: [PATCH 5/5] Update README --- README.md | 6 ++++-- etc/adminhtml/system.xml | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d3db344..4e0c76a 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,10 @@ This extension allows the user to start the session within the Vue Storefront sh ![External checkout for Vue Storefront](https://raw.githubusercontent.com/Vendic/vsf-external-checkout/master/media/diagram.png) ### Demo -You can check this extension in action on: https://demo-magento-checkout.vuestorefront.io -Please add some items to the cart and then go to **Cart -> Go to checkout**. You will be redirected to the [Magento2 instance](http://demo-magento2.vuestorefront.io/) synchronized with the [Vue Storefront instance](demo-magento-checkout.vuestorefront.io). Shopping carts, logged in user, totals, item prices - should be synchronized with Magento 2. +[A demo is not yet available.](https://github.com/Vendic/magento2-external-checkout/issues/1) + +### Compatibility +- Magento 2.2 or Magento 2.3 ### Prerequisites (the Vue Storefront part) 1. Integrate Your Magento2 instance with Vue Storefront: [tutorial](https://medium.com/@piotrkarwatka/vue-storefront-cart-totals-orders-integration-with-magento2-6fbe6860fcd), [video tutorial](https://www.youtube.com/watch?v=CtDXddsyxvM) diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 9ce66dc..7f55b3d 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -16,14 +16,14 @@ - After a transaction, we will redirect the traffic to this URL. For example + After a transaction, we will redirect the traffic to this URL. For example: 'https://demo.vuestorefront.io/succespage' - We will redirect the traffic from VueStorefront to this path. For example 'checkout/cart' + We will redirect the traffic from VueStorefront to this path. For example 'checkout/cart' or 'checkout'