-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '5.3' into feature/5.x-purgeevent
- Loading branch information
Showing
51 changed files
with
1,384 additions
and
260 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
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 |
---|---|---|
@@ -1,8 +1,26 @@ | ||
# Release Notes for Craft Commerce (WIP) | ||
|
||
## Administration | ||
### Store Management | ||
- It is now possible to design card views for Products and Variants. ([#3809](https://github.com/craftcms/commerce/pull/3809)) | ||
- Order conditions can now have a “Coupon Code” rule. ([#3776](https://github.com/craftcms/commerce/discussions/3776)) | ||
- Order conditions can now have a “Payment Gateway” rule. ([#3722](https://github.com/craftcms/commerce/discussions/3722)) | ||
- Variant conditions can now have a “Product” rule. | ||
|
||
- Added `craft\commerce\events\CartPurgeEvent`. | ||
### Development | ||
- Added support for `to`, `bcc`, and `cc` email fields to support environment variables. ([#3738](https://github.com/craftcms/commerce/issues/3738)) | ||
- Added the `couponCode` order query param. | ||
- Added an `originalCart` value to the `commerce/update-cart` failed ajax response. ([#430](https://github.com/craftcms/commerce/issues/430)) | ||
- Added a new "Payment Gateway" order condition rule. ([#3722](https://github.com/craftcms/commerce/discussions/3722)) | ||
|
||
### Extensibility | ||
- Added `craft\commerce\base\InventoryItemTrait`. | ||
- Added `craft\commerce\base\InventoryLocationTrait`. | ||
- Added `craft\commerce\elements\conditions\orders\CouponCodeConditionRule`. | ||
- Added `craft\commerce\elements\conditions\variants\ProductConditionRule`. | ||
- Added `craft\commerce\elements\db\OrderQuery::$couponCode`. | ||
- Added `craft\commerce\elements\db\OrderQuery::couponCode()`. | ||
- Added `craft\commerce\events\CartPurgeEvent`. | ||
- Added `craft\commerce\services\Inventory::updateInventoryLevel()`. | ||
- Added `craft\commerce\services\Inventory::updatePurchasableInventoryLevel()`. | ||
|
||
### System | ||
- Craft Commerce now requires Craft CMS 5.5 or later. |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,61 @@ | ||
<?php | ||
/** | ||
* @link https://craftcms.com/ | ||
* @copyright Copyright (c) Pixel & Tonic, Inc. | ||
* @license https://craftcms.github.io/license/ | ||
*/ | ||
|
||
namespace craft\commerce\base; | ||
|
||
use craft\commerce\models\InventoryItem; | ||
use craft\commerce\Plugin; | ||
|
||
/** | ||
* Inventory Item Trait | ||
* | ||
* @author Pixel & Tonic, Inc. <[email protected]> | ||
* @since 5.3.0 | ||
*/ | ||
trait InventoryItemTrait | ||
{ | ||
/** | ||
* @var int|null The inventory item ID | ||
*/ | ||
public ?int $inventoryItemId = null; | ||
|
||
/** | ||
* @var InventoryItem|null The inventory item | ||
* @see getInventoryItem() | ||
* @see setInventoryItem() | ||
*/ | ||
private ?InventoryItem $_inventoryItem = null; | ||
|
||
/** | ||
* @param InventoryItem|null $inventoryItem | ||
* @return void | ||
*/ | ||
public function setInventoryItem(?InventoryItem $inventoryItem): void | ||
{ | ||
$this->_inventoryItem = $inventoryItem; | ||
$this->inventoryItemId = $inventoryItem?->id ?? null; | ||
} | ||
|
||
/** | ||
* @return InventoryItem|null | ||
* @throws \yii\base\InvalidConfigException | ||
*/ | ||
public function getInventoryItem(): ?InventoryItem | ||
{ | ||
if (isset($this->_inventoryItem)) { | ||
return $this->_inventoryItem; | ||
} | ||
|
||
if ($this->inventoryItemId) { | ||
$this->_inventoryItem = Plugin::getInstance()->getInventory()->getInventoryItemById($this->inventoryItemId); | ||
|
||
return $this->_inventoryItem; | ||
} | ||
|
||
return null; | ||
} | ||
} |
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,61 @@ | ||
<?php | ||
/** | ||
* @link https://craftcms.com/ | ||
* @copyright Copyright (c) Pixel & Tonic, Inc. | ||
* @license https://craftcms.github.io/license/ | ||
*/ | ||
|
||
namespace craft\commerce\base; | ||
|
||
use craft\commerce\models\InventoryLocation; | ||
use craft\commerce\Plugin; | ||
|
||
/** | ||
* Inventory Location Trait | ||
* | ||
* @author Pixel & Tonic, Inc. <[email protected]> | ||
* @since 5.3.0 | ||
*/ | ||
trait InventoryLocationTrait | ||
{ | ||
/** | ||
* @var int|null The inventory item ID | ||
*/ | ||
public ?int $inventoryLocationId = null; | ||
|
||
/** | ||
* @var InventoryLocation|null The inventory item | ||
* @see getInventoryLocation() | ||
* @see setInventoryLocation() | ||
*/ | ||
private ?InventoryLocation $_inventoryLocation = null; | ||
|
||
/** | ||
* @param InventoryLocation|null $inventoryLocation | ||
* @return void | ||
*/ | ||
public function setInventoryLocation(?InventoryLocation $inventoryLocation): void | ||
{ | ||
$this->_inventoryLocation = $inventoryLocation; | ||
$this->inventoryLocationId = $inventoryLocation?->id ?? null; | ||
} | ||
|
||
/** | ||
* @return InventoryLocation|null | ||
* @throws \yii\base\InvalidConfigException | ||
*/ | ||
public function getInventoryLocation(): ?InventoryLocation | ||
{ | ||
if (isset($this->_inventoryLocation)) { | ||
return $this->_inventoryLocation; | ||
} | ||
|
||
if ($this->inventoryLocationId) { | ||
$this->_inventoryLocation = Plugin::getInstance()->getInventoryLocations()->getInventoryLocationById($this->inventoryLocationId); | ||
|
||
return $this->_inventoryLocation; | ||
} | ||
|
||
return null; | ||
} | ||
} |
Oops, something went wrong.