forked from Smile-SA/magento2-module-store-delivery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:Smile-SA/magento2-module-store-de…
…livery * 'master' of github.com:Smile-SA/magento2-module-store-delivery: Create README.md Fix Smile-SA#9 - Fix observer when store delivery method is disabled Add issue template Rename Carrier Model to prevent magento failure when exploding on underscores. Fix Temando erratic observer. Remove page layout update Remove PHP dependency. Let Magento handle it.
- Loading branch information
Showing
12 changed files
with
143 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!--- Provide a general summary of the issue in the Title above --> | ||
|
||
### Preconditions | ||
<!--- Please Provide detailed informations about the environment you use --> | ||
|
||
<!-- Magento Version : Are you using Magento CE or EE ? Which version of Magento are you using exactly ? --> | ||
Magento Version : | ||
|
||
<!-- Module Store Delivery Version : Which exact version of Module Store Delivery are you using ? --> | ||
Module Store Delivery Version : | ||
|
||
<!-- Magento Environment : are you in Developer or Production mode ? --> | ||
Environment : | ||
|
||
<!-- Third party modules : are you using any third party modules ? If yes, please attach the list --> | ||
Third party modules : | ||
|
||
### Steps to reproduce | ||
<!--- Provide a set of unambiguous steps to reproduce this bug. You can also include pieces of code if you think it's relevant --> | ||
1. | ||
2. | ||
3. | ||
|
||
### Expected result | ||
<!--- Tell us what should happen --> | ||
1. | ||
|
||
### Actual result | ||
<!--- Tell us what happens instead --> | ||
1. [Screenshot, logs] | ||
|
||
<!--- (This may be platform independent comment) --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
/** | ||
* DISCLAIMER | ||
* Do not edit or add to this file if you wish to upgrade this module to newer | ||
* versions in the future. | ||
* | ||
* @category Smile | ||
* @package Smile\StoreDelivery | ||
* @author Romain Ruaud <[email protected]> | ||
* @copyright 2018 Smile | ||
* @license Open Software License ("OSL") v. 3.0 | ||
*/ | ||
namespace Smile\StoreDelivery\Plugin\Temando; | ||
|
||
/** | ||
* This observer is here to prevent erratic behavior of Temando module. @see https://github.com/magento/magento2/issues/12921 | ||
* | ||
* @category Smile | ||
* @package Smile\StoreDelivery | ||
* @author Romain Ruaud <[email protected]> | ||
*/ | ||
class SaveCheckoutFieldsObserverPlugin | ||
{ | ||
/** | ||
* Better check than what is done in the Temando Observer which is thinking he is the only one adding extension | ||
* attributes to the Quote address. | ||
* | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
* | ||
* @param \Temando\Shipping\Observer\SaveCheckoutFieldsObserver $subject Base Temando Observer | ||
* @param \Closure $proceed execute() method of Temando Observer | ||
* @param \Magento\Framework\Event\Observer $observer Magento Event Observer | ||
*/ | ||
public function aroundExecute( | ||
\Temando\Shipping\Observer\SaveCheckoutFieldsObserver $subject, | ||
\Closure $proceed, | ||
\Magento\Framework\Event\Observer $observer | ||
) { | ||
/** @var \Magento\Quote\Api\Data\AddressInterface|\Magento\Quote\Model\Quote\Address $quoteAddress */ | ||
$quoteAddress = $observer->getData('quote_address'); | ||
if ($quoteAddress->getAddressType() !== \Magento\Quote\Model\Quote\Address::ADDRESS_TYPE_SHIPPING) { | ||
return; | ||
} | ||
|
||
if (!$quoteAddress->getExtensionAttributes()) { | ||
return; | ||
} | ||
|
||
if (!$quoteAddress->getExtensionAttributes()->getCheckoutFields()) { | ||
return; | ||
} | ||
|
||
$proceed($observer); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
### Smile Store Delivery | ||
|
||
This module is a plugin for [ElasticSuite](https://github.com/Smile-SA/elasticsuite). | ||
|
||
This module add the ability to be delivered in store. Store delivery is a shipping method. | ||
|
||
### Requirements | ||
|
||
The module requires : | ||
|
||
- [Store Locator](https://github.com/Smile-SA/magento2-module-store-locator) > 1.2.* | ||
|
||
### How to use | ||
|
||
1. Install the module via Composer : | ||
|
||
``` composer require smile/module-store-delivery ``` | ||
|
||
2. Enable it | ||
|
||
``` bin/magento module:enable Smile_StoreDelivery ``` | ||
|
||
3. Install the module and rebuild the DI cache | ||
|
||
``` bin/magento setup:upgrade ``` | ||
|
||
### How to configure | ||
|
||
> Stores > Configuration > Sales > Shipping Methods > Store Delivery | ||
Field | Type | ||
-----------------------------|---------------------------------------------- | ||
Enabled | Yes/No | ||
Title | Varchar | ||
Method Name | Varchar | ||
Price | Decimal | ||
Calculate Handling Fee | Fixed/Percent | ||
Handling Fee | Varchar | ||
Displayed Error Message | Text | ||
Ship to Applicable Countries | All Allowed Countries/Specific Countries | ||
Ship to Specific Countries | Varchar (Multiselect countries) | ||
Sort Order | Integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters