Skip to content

Commit 50e66eb

Browse files
committed
Merge branch '5.5' into feature/variant-title-format-regen-conditional
2 parents 3c0adc4 + 7c353ee commit 50e66eb

File tree

7 files changed

+26
-18
lines changed

7 files changed

+26
-18
lines changed

CHANGELOG-WIP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- PDF link expiry duration can now be configured per PDF in Settings → PDFs.
88
- Logged-in users who own the order or have appropriate permissions bypass the email verification flow and can download PDFs directly.
99
- Added a new system email message for sending PDF download links to customers.
10+
- It is now possible to select multiple products in variant conditions.
1011

1112
### Administration
1213
- Added billing and shipping address conditions to gateways. ([#4100](https://github.com/craftcms/commerce/pull/4100))

src/controllers/PlansController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function actionEditPlan(int $planId = null, Plan $plan = null): Response
144144
->title($variables['title'])
145145
->selectedSubnavItem('subscription-plans')
146146
->addCrumb(Craft::t('commerce', 'Commerce'), 'commerce')
147-
->addCrumb(Craft::t('commerce', 'Plans'), 'commerce/subscription-plans')
147+
->addCrumb(Craft::t('commerce', 'Subscription Plans'), 'commerce/subscription-plans')
148148
->contentTemplate('commerce/subscriptions/plans/_edit.twig', $variables)
149149
->action('commerce/plans/save-plan')
150150
->redirectUrl('commerce/subscription-plans')

src/elements/conditions/variants/ProductConditionRule.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getExclusiveQueryParams(): array
5454
public function modifyQuery(ElementQueryInterface $query): void
5555
{
5656
/** @var VariantQuery $query */
57-
$query->ownerId($this->getElementId());
57+
$query->ownerId($this->getElementIds());
5858
}
5959

6060
/**
@@ -63,7 +63,15 @@ public function modifyQuery(ElementQueryInterface $query): void
6363
public function matchElement(ElementInterface $element): bool
6464
{
6565
/** @var Variant $element */
66-
return $element->getOwnerId() == $this->getElementId();
66+
return $this->matchValue($element->getOwnerId());
67+
}
68+
69+
/**
70+
* @inheritdoc
71+
*/
72+
protected function allowMultiple(): bool
73+
{
74+
return true;
6775
}
6876

6977
/**

src/models/ProductType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function init(): void
252252
if (!isset($this->previewTargets)) {
253253
$this->previewTargets = [
254254
[
255-
'label' => Craft::t('commerce', 'Primary {type} page', [
255+
'label' => Craft::t('app', 'Primary {type} page', [
256256
'type' => Product::lowerDisplayName(),
257257
]),
258258
'urlFormat' => '{url}',
@@ -566,7 +566,7 @@ public function validatePreviewTargets(): void
566566
unset($target);
567567

568568
if ($hasErrors) {
569-
$this->addError('previewTargets', Craft::t('commerce', 'All targets must have a label.'));
569+
$this->addError('previewTargets', Craft::t('app', 'All targets must have a label.'));
570570
}
571571
}
572572

src/templates/settings/emails/_edit.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182

183183
{{ forms.selectField({
184184
label: 'Language'|t('commerce'),
185-
instructions: "The language to be used when email is rendered."|t('commerce'),
185+
instructions: "The language to be used when this email is rendered."|t('commerce'),
186186
id: 'language',
187187
name: 'language',
188188
options : emailLanguageOptions,
@@ -194,7 +194,7 @@
194194

195195
{{ forms.selectField({
196196
label: 'Site'|t('app'),
197-
instructions: "The site to be used when email is rendered."|t('commerce'),
197+
instructions: "The site to be used when this email is rendered."|t('commerce'),
198198
id: 'renderSiteId',
199199
name: 'renderSiteId',
200200
options : emailRenderSiteOptions,

src/templates/settings/pdfs/_edit.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
}) }}
124124

125125
{{ forms.textField({
126-
label: "Link Expiry"|t('commerce'),
126+
label: 'Link Duration'|t('commerce'),
127127
instructions: "How long (in seconds) a PDF download link should remain valid before expiring. Default is 86400 (24 hours)."|t('commerce'),
128128
id: 'linkExpiry',
129129
name: 'linkExpiry',

src/translations/en/commerce.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
'(of original price)' => '(of original price)',
1111
'(off original price)' => '(off original price)',
1212
'A cart number must be specified.' => 'A cart number must be specified.',
13+
'A friendly reference number will be generated based on this format when a cart is completed and becomes an order. For example {ex1}, or<br> {ex2}. The result of this format must be unique.' => 'A friendly reference number will be generated based on this format when a cart is completed and becomes an order. For example {ex1}, or<br> {ex2}. The result of this format must be unique.',
1314
'A new download link has been sent to {email}' => 'A new download link has been sent to {email}',
1415
'A new download link will be sent to {email}' => 'A new download link will be sent to {email}',
15-
'A friendly reference number will be generated based on this format when a cart is completed and becomes an order. For example {ex1}, or<br> {ex2}. The result of this format must be unique.' => 'A friendly reference number will be generated based on this format when a cart is completed and becomes an order. For example {ex1}, or<br> {ex2}. The result of this format must be unique.',
1616
'A valid email is required to create a customer.' => 'A valid email is required to create a customer.',
1717
'Accept' => 'Accept',
1818
'Accepted' => 'Accepted',
@@ -276,7 +276,6 @@
276276
'Coupons' => 'Coupons',
277277
'Craft Commerce' => 'Craft Commerce',
278278
'Create a Discount' => 'Create a Discount',
279-
'Create a Product Type' => 'Create a Product Type',
280279
'Create a Subscription Plan' => 'Create a Subscription Plan',
281280
'Create a new PDF' => 'Create a new PDF',
282281
'Create a new catalog pricing rule' => 'Create a new catalog pricing rule',
@@ -470,14 +469,14 @@
470469
'Example' => 'Example',
471470
'Exclude this discount for products that are already on promotion' => 'Exclude this discount for products that are already on promotion',
472471
'Expand' => 'Expand',
473-
'Expired' => 'Expired',
474472
'Expired Link' => 'Expired Link',
473+
'Expired' => 'Expired',
475474
'Expiry Date' => 'Expiry Date',
476475
'Expiry date' => 'Expiry date',
477476
'Expiry' => 'Expiry',
478477
'Failed to receive transfer: {error}' => 'Failed to receive transfer: {error}',
479-
'Failed to start' => 'Failed to start',
480478
'Failed to send email. Please try again.' => 'Failed to send email. Please try again.',
479+
'Failed to start' => 'Failed to start',
481480
'Failed to update {num, plural, =1{order status} other{order statuses}}.' => 'Failed to update {num, plural, =1{order status} other{order statuses}}.',
482481
'Failed updating order status on {num, plural, =1{order} other{orders}}.' => 'Failed updating order status on {num, plural, =1{order} other{orders}}.',
483482
'Feet (ft)' => 'Feet (ft)',
@@ -623,11 +622,11 @@
623622
'Line item price (minus discounts)' => 'Line item price (minus discounts)',
624623
'Line item shipping cost' => 'Line item shipping cost',
625624
'Line item statuses reordered.' => 'Line item statuses reordered.',
625+
'Link Duration' => 'Link Duration',
626+
'Link Sent' => 'Link Sent',
626627
'Link to a product' => 'Link to a product',
627628
'Link to a variant' => 'Link to a variant',
628629
'Link' => 'Link',
629-
'Link Expiry' => 'Link Expiry',
630-
'Link Sent' => 'Link Sent',
631630
'Live' => 'Live',
632631
'Location' => 'Location',
633632
'MM' => 'MM',
@@ -787,6 +786,7 @@
787786
'Order Description Format' => 'Order Description Format',
788787
'Order Details' => 'Order Details',
789788
'Order Fields' => 'Order Fields',
789+
'Order PDF Download Link' => 'Order PDF Download Link',
790790
'Order PDF Filename Format' => 'Order PDF Filename Format',
791791
'Order Reference Number Format' => 'Order Reference Number Format',
792792
'Order Settings' => 'Order Settings',
@@ -799,7 +799,6 @@
799799
'Order deleted.' => 'Order deleted.',
800800
'Order fields saved.' => 'Order fields saved.',
801801
'Order not found.' => 'Order not found.',
802-
'Order PDF Download Link' => 'Order PDF Download Link',
803802
'Order payment balance is {outstandingBalanceAsCurrency}. This is the maximum value that will be charged.' => 'Order payment balance is {outstandingBalanceAsCurrency}. This is the maximum value that will be charged.',
804803
'Order recalculated.' => 'Order recalculated.',
805804
'Order status saved.' => 'Order status saved.',
@@ -864,7 +863,6 @@
864863
'Plain Text Email Template Path' => 'Plain Text Email Template Path',
865864
'Plan' => 'Plan',
866865
'Plans reordered.' => 'Plans reordered.',
867-
'Plans' => 'Plans',
868866
'Portrait' => 'Portrait',
869867
'Post Date' => 'Post Date',
870868
'Postal Code Formula' => 'Postal Code Formula',
@@ -1124,10 +1122,10 @@
11241122
'The address provided is outside the store’s market.' => 'The address provided is outside the store’s market.',
11251123
'The amount of discount that is applied to the whole order. This amount is spread across line items in order of highest price to lowest price, until the discount is used up.' => 'The amount of discount that is applied to the whole order. This amount is spread across line items in order of highest price to lowest price, until the discount is used up.',
11261124
'The base discount can only discount items in the cart to down to zero until it is used up, it can not make the order negative.' => 'The base discount can only discount items in the cart to down to zero until it is used up, it can not make the order negative.',
1127-
'The download link is invalid. Please request a new one.' => 'The download link is invalid. Please request a new one.',
11281125
'The conversion rate that will be used when converting an amount to this currency. For example, if an item costs {amount1}, a conversion rate of {rate} would result in {amount2} in the alternate currency.' => 'The conversion rate that will be used when converting an amount to this currency. For example, if an item costs {amount1}, a conversion rate of {rate} would result in {amount2} in the alternate currency.',
11291126
'The countries that orders are allowed to be placed from.' => 'The countries that orders are allowed to be placed from.',
11301127
'The default shipping category is automatically available to all product types.' => 'The default shipping category is automatically available to all product types.',
1128+
'The download link is invalid. Please request a new one.' => 'The download link is invalid. Please request a new one.',
11311129
'The email address that order status emails are sent from. Leave blank to use the System Email Address defined in Craft’s General Settings.' => 'The email address that order status emails are sent from. Leave blank to use the System Email Address defined in Craft’s General Settings.',
11321130
'The entry that contains the description for this subscription’s plan.' => 'The entry that contains the description for this subscription’s plan.',
11331131
'The flat value which should discount each item. i.e “3” for $3 off each item.' => 'The flat value which should discount each item. i.e “3” for $3 off each item.',
@@ -1136,6 +1134,7 @@
11361134
'The inventory locations this store uses.' => 'The inventory locations this store uses.',
11371135
'The item is not enabled for sale.' => 'The item is not enabled for sale.',
11381136
'The language the order was made in.' => 'The language the order was made in.',
1137+
'The language to be used when this email is rendered.' => 'The language to be used when this email is rendered.',
11391138
'The maximum number of levels this product type can have. Leave blank if you don’t care.' => 'The maximum number of levels this product type can have. Leave blank if you don’t care.',
11401139
'The maximum the customer should spend on shipping. Set to zero to disable.' => 'The maximum the customer should spend on shipping. Set to zero to disable.',
11411140
'The minimum the customer should spend on shipping. Set to zero to disable.' => 'The minimum the customer should spend on shipping. Set to zero to disable.',
@@ -1151,7 +1150,7 @@
11511150
'The recipient of the email. Twig code can be used here.' => 'The recipient of the email. Twig code can be used here.',
11521151
'The reply to email address. Leave blank for normal reply to of email sender. Twig code can be used here.' => 'The reply to email address. Leave blank for normal reply to of email sender. Twig code can be used here.',
11531152
'The site the order was made in.' => 'The site the order was made in.',
1154-
'The site to be used when email is rendered.' => 'The site to be used when email is rendered.',
1153+
'The site to be used when this email is rendered.' => 'The site to be used when this email is rendered.',
11551154
'The subject line of the email. Twig code can be used here.' => 'The subject line of the email. Twig code can be used here.',
11561155
'The template that the PDF should be generated from.' => 'The template that the PDF should be generated from.',
11571156
'The template to be used for HTML emails.' => 'The template to be used for HTML emails.',

0 commit comments

Comments
 (0)