Skip to content

Commit f788325

Browse files
committed
Merge branch '5.x' of github.com:craftcms/commerce into 5.x
# Conflicts: # CHANGELOG.md
2 parents a453bfb + 2c19aec commit f788325

File tree

6 files changed

+50
-4
lines changed

6 files changed

+50
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
## Unreleased
44

5-
- Fixed a bug where tax and shipping categories werent getting saved on the Edit variant screen. ([#4180](https://github.com/craftcms/commerce/issues/4180))
5+
- Fixed a bug where tax and shipping categories weren't getting saved on the Edit variant screen. ([#4180](https://github.com/craftcms/commerce/issues/4180))
66
- Fixed a bug where newly created variants weren’t visible on Edit product screens.
77
- Fixed a SQL error that could occur when viewing product indexes.
88
- Fixed a PHP error that occurred when applying project config changes after updating. ([#4185](https://github.com/craftcms/commerce/issues/4185))
99
- Fixed a bug where an Order’s origin was set incorrectly when creating an order in the control panel.
10+
- Added the missing Preview Targets UI to product type settings. ([#4127](https://github.com/craftcms/commerce/issues/4127))
1011
- Fixed a bug where prices weren’t showing formatted per the user’s formatting locale, in payment modals on Edit Order pages.
1112

1213
## 5.5.0.1 - 2025-11-24

src/controllers/ProductTypesController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public function actionSaveProductType(): ?Response
161161
$maxLevels = (int)$this->request->getBodyParam('maxLevels');
162162
$productType->maxLevels = $maxLevels ?: null; // zero should be null
163163
$productType->defaultPlacement = $this->request->getBodyParam('defaultPlacement');
164+
$productType->previewTargets = $this->request->getBodyParam('previewTargets') ?: [];
164165

165166
// Site-specific settings
166167
$allSiteSettings = [];

src/templates/settings/producttypes/_edit.twig

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,41 @@
440440
errors: siteErrors|unique
441441
}) }}
442442

443+
{% if not headlessMode %}
444+
{{ forms.editableTableField({
445+
label: 'Preview Targets'|t('app'),
446+
id: 'previewTargets',
447+
name: 'previewTargets',
448+
cols: {
449+
label: {
450+
type: 'singleline',
451+
heading: 'Label'|t('app'),
452+
},
453+
urlFormat: {
454+
type: 'singleline',
455+
heading: 'URL Format'|t('app'),
456+
info: 'The URL/URI to use for this target.'|t('app'),
457+
code: true,
458+
},
459+
refresh: {
460+
type: 'checkbox',
461+
heading: 'Auto-refresh'|t('app'),
462+
info: 'Whether preview frames should be automatically refreshed when content changes.'|t('app'),
463+
thin: true,
464+
}
465+
},
466+
defaultValues: {
467+
refresh: true,
468+
},
469+
allowAdd: true,
470+
allowReorder: true,
471+
allowDelete: true,
472+
rows: productType.previewTargets,
473+
errors: productType.getErrors('previewTargets'),
474+
static: readOnly,
475+
}) }}
476+
{% endif %}
477+
443478
{% if craft.app.getIsMultiSite() %}
444479
<div class="field">
445480
{{ forms.selectField({

src/web/assets/inventory/dist/css/inventory.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/inventory/dist/css/inventory.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/inventory/src/css/inventory.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
.inventory-headers,
1+
.inventory-headers {
2+
.ltr & {
3+
justify-content: flex-end;
4+
}
5+
6+
.rtl & {
7+
justify-content: flex-start;
8+
}
9+
}
10+
211
.inventory-cell {
312
.ltr & {
413
text-align: right;

0 commit comments

Comments
 (0)