In Hyvä (and Magento generally), the displayed SKU does not change automatically when a shopper selects different options for a configurable product. A small code change can fix this. Override the file /vendor/hyva-themes/magento2-default-theme/Magento_ConfigurableProduct/templates/product/view/type/options/js/configurable-options.phtml in your Hyvä child theme as follows:…
Removing the SKU from the product page (Magento 2)
To remove the product SKU from a Magento 2 product page, open the file catalog_product_view.xml in your Magento theme and add the following line to the <body>…</body> Bereich hinzu:
|
1 |
<referenceBlock name="product.info.sku" remove="true" /> |
Sort order items by SKU (Magento 1)
If you want to change the default sorting of the ordered items on the order detail page, go ahead and override app/design/adminhtml/default/default/template/sales/order/view/items.phtml in your theme and replace
Sorting order items by SKU (Magento 1)
To display ordered products sorted by SKU in the order view, override the app/design/adminhtml/default/default/template/sales/order/view/items.phtml in your theme and replace
|
1 2 3 4 5 6 7 8 |
<?php $_items = $this->getItemsCollection() ?> <?php $i=0;foreach ($_items as $_item):?> <?php if ($_item->getParentItem()) continue; else $i++;?> <tbody class="<?php echo $i%2?'even':'odd' ?>"> <?php echo $this->getItemHtml($_item) ?> <?php echo $this->getItemExtraInfoHtml($_item) ?> </tbody> <?php endforeach; ?> |
with
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?php $_items = $this->getItemsCollection() ?> <?php $_sortedItems = array(); ?> <?php foreach ($_items as $_item) : ?> <?php $_sortedItems[$_item->getSku()] = $_item;?> <?php endforeach;?> <?php ksort($_sortedItems); // Sort by array keys ?> <?php $i=0;foreach ($_sortedItems as $_item):?> <?php if ($_item->getParentItem()) continue; else $i++;?> <tbody class="<?php echo $i%2?'even':'odd' ?>"> <?php echo $this->getItemHtml($_item) ?> <?php echo $this->getItemExtraInfoHtml($_item) ?> </tbody> <?php endforeach; ?> |
That’s it. When you open an order containing two or more products, they will now be displayed in…