Skip to content

Commit

Permalink
Fixed #3271
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeholder committed Oct 17, 2023
1 parent 8700421 commit 531a4d3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Improved the performance of the `commerce/upgrade` command. ([#3286](https://github.com/craftcms/commerce/issues/3286))
- Added the `commerce/gateways/list` command.
- Added the `commerce/gateways/webhook-url` command.
- Added `craft\commerce\models\ShippingMethodOption::$shippingMethod`. ([#3274](https://github.com/craftcms/commerce/pull/3274), [#3271](https://github.com/craftcms/commerce/issues/3271))
- Fixed a bug where the delete button would be shown for users that do not have permission to delete on the Product edit page. ([#3285](https://github.com/craftcms/commerce/issues/3285))
- Fixed a bug where deleted shipping categories were still available for selection. ([#3272](https://github.com/craftcms/commerce/issues/3272))
- Fixed a bug where the customer condition rule wasn’t loading correctly. ([#3291](https://github.com/craftcms/commerce/issues/3291))
Expand All @@ -13,7 +14,8 @@
- Fixed a bug where duplicate inactive users could be created when using the `commerce/upgrade` command. ([#3286](https://github.com/craftcms/commerce/issues/3286))
- Fixed a bug where the `commerce/payments/pay` action was missing the `redirect` in JSON responses. ([#3265](https://github.com/craftcms/commerce/issues/3265))
- The order param is now included when triggering the `craft\commerce\services\Purchasables::EVENT_PURCHASABLE_SHIPPABLE` event. ([#3279](https://github.com/craftcms/commerce/pull/3279))
- The auto-generated variant titles and SKUs are now generated when before saving a product in addition to before validation. ((#3297)[https://github.com/craftcms/commerce/pull/3297])
- The auto-generated variant titles and SKUs are now generated when before saving a product in addition to before validation. ([#3297](https://github.com/craftcms/commerce/pull/3297))


## 4.3.0 - 2023-09-13

Expand Down
1 change: 1 addition & 0 deletions src/elements/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -2016,6 +2016,7 @@ public function getAvailableShippingMethodOptions(): array
$option->handle = $method->getHandle();
$option->matchesOrder = ArrayHelper::isIn($method->getHandle(), $matchingMethodHandles);
$option->price = $method->getPriceForOrder($this);
$option->shippingMethod = $method;

// Add all methods if completed, and only the matching methods when it is not completed.
if ($this->isCompleted || $option->matchesOrder) {
Expand Down
6 changes: 6 additions & 0 deletions src/models/ShippingMethodOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace craft\commerce\models;

use craft\commerce\base\ShippingMethodInterface;
use craft\commerce\behaviors\CurrencyAttributeBehavior;
use craft\commerce\elements\Order;
use craft\commerce\Plugin;
Expand Down Expand Up @@ -39,6 +40,11 @@ class ShippingMethodOption extends ShippingMethod
*/
public bool $matchesOrder;

/**
* @var ?ShippingMethodInterface
*/
public ?ShippingMethodInterface $shippingMethod = null;

/**
* @throws InvalidConfigException
*/
Expand Down

0 comments on commit 531a4d3

Please sign in to comment.