-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: dpz weight classes automatically selected and retained (#53)
Co-authored-by: Joeri van Veen <joeri@myparcel.nl> Co-authored-by: Edie Lemoine <edie@myparcel.nl>
- Loading branch information
1 parent
a274f3f
commit e398582
Showing
31 changed files
with
840 additions
and
195 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 |
---|---|---|
|
@@ -27,4 +27,4 @@ | |
"scripts": { | ||
"format": "vendor/bin/php-cs-fixer fix ." | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -37,4 +37,4 @@ | |
"browserslist": [ | ||
"defaults" | ||
] | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Gett\MyparcelBE\DeliverySettings; | ||
|
||
use Gett\MyparcelBE\Model\Core\Order; | ||
use MyParcelNL\Sdk\src\Adapter\DeliveryOptions\AbstractDeliveryOptionsAdapter; | ||
|
||
class DeliverySettings | ||
{ | ||
/** | ||
* @param \Gett\MyparcelBE\Model\Core\Order $order | ||
* | ||
* @return \MyParcelNL\Sdk\src\Adapter\DeliveryOptions\AbstractDeliveryOptionsAdapter | ||
*/ | ||
public static function getDeliveryOptionsFromOrder(Order $order): AbstractDeliveryOptionsAdapter | ||
{ | ||
return DeliverySettingsRepository::getInstance()::getDeliveryOptionsByCartId((int) $order->id_cart); | ||
} | ||
|
||
/** | ||
* @param \Gett\MyparcelBE\Model\Core\Order $order | ||
* | ||
* @return \Gett\MyparcelBE\DeliverySettings\ExtraOptions | ||
*/ | ||
public static function getExtraOptionsFromOrder(Order $order): ExtraOptions | ||
{ | ||
return DeliverySettingsRepository::getInstance()::getExtraOptionsByCartId((int) $order->id_cart); | ||
} | ||
|
||
/** | ||
* @throws \PrestaShopDatabaseException | ||
*/ | ||
public static function persist(): void | ||
{ | ||
DeliverySettingsRepository::getInstance()::persist(); | ||
} | ||
|
||
/** | ||
* @param \MyParcelNL\Sdk\src\Adapter\DeliveryOptions\AbstractDeliveryOptionsAdapter $deliveryOptions | ||
* @param \Gett\MyparcelBE\Model\Core\Order $order | ||
* | ||
* @return void | ||
*/ | ||
public static function setDeliveryOptionsForOrder( | ||
AbstractDeliveryOptionsAdapter $deliveryOptions, | ||
Order $order | ||
): void { | ||
DeliverySettingsRepository::getInstance()::setDeliveryOptionsForOrder($deliveryOptions, $order); | ||
} | ||
|
||
/** | ||
* @param \Gett\MyparcelBE\DeliverySettings\ExtraOptions $extraOptions | ||
* @param \Gett\MyparcelBE\Model\Core\Order $order | ||
* | ||
* @return void | ||
*/ | ||
public static function setExtraOptionsForOrder(ExtraOptions $extraOptions, Order $order): void | ||
{ | ||
DeliverySettingsRepository::getInstance()::setExtraOptionsForOrder($extraOptions, $order); | ||
} | ||
} |
Oops, something went wrong.