ver. 0.303: Fix attribute display collision + product preview button

Fix: product attributes with the same sort order value were overwriting
each other in getProductAttributes(), causing only one attribute to
display on the frontend. Now uses usort() with sequential keys.

New: Preview button in product edit form opens product page in new tab.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 15:04:51 +01:00
parent 6fdbe61916
commit e1f9b3e517
6 changed files with 43 additions and 44 deletions

View File

@@ -547,6 +547,11 @@ class ShopProductController
FormAction::cancel( $backUrl ),
];
if ( $productId > 0 ) {
$previewUrl = $this->repository->getProductUrl( $productId );
$actions[] = FormAction::preview( $previewUrl );
}
return new FormEditViewModel(
'product-edit',
$title,