Rename module to AdminOrderColumns and add thumbnail removal
Major changes: - Renamed module from OrderItemsCustom to AdminOrderColumns for clarity - Added CSS to hide product thumbnails in order items view - Updated all namespaces from Shopkeeper\OrderItemsCustom to Shopkeeper\AdminOrderColumns - Updated composer package name to shopkeeper/module-admin-order-columns - Bumped version to 1.1.0 - Added layout XML and CSS files for thumbnail removal - Updated all documentation and installation instructions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Shopkeeper\OrderItemsCustom\Plugin\Order\View\Items\Renderer;
|
namespace Shopkeeper\AdminOrderColumns\Plugin\Order\View\Items\Renderer;
|
||||||
|
|
||||||
use Magento\Catalog\Api\ProductRepositoryInterface;
|
use Magento\Catalog\Api\ProductRepositoryInterface;
|
||||||
use Magento\Framework\Exception\NoSuchEntityException;
|
use Magento\Framework\Exception\NoSuchEntityException;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Shopkeeper\OrderItemsCustom\Plugin\Order\View;
|
namespace Shopkeeper\AdminOrderColumns\Plugin\Order\View;
|
||||||
|
|
||||||
class ItemsColumns
|
class ItemsColumns
|
||||||
{
|
{
|
||||||
|
|||||||
43
README.md
43
README.md
@@ -1,10 +1,11 @@
|
|||||||
# Shopkeeper Order Items Custom
|
# Shopkeeper Admin Order Columns
|
||||||
|
|
||||||
A Magento 2 module that customizes the order item columns in the Magento admin panel. This module removes tax columns, adds a cost column, and makes product names and SKUs clickable for quick product editing.
|
A Magento 2 module that customizes the order item columns in the Magento admin panel. This module removes tax columns, adds a cost column, hides product thumbnails, and makes product names and SKUs clickable for quick product editing.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Remove Tax Columns**: Hides tax amount and tax percent columns from order item view
|
- **Remove Tax Columns**: Hides tax amount and tax percent columns from order item view
|
||||||
|
- **Hide Product Thumbnails**: Removes product images from order items for cleaner layout
|
||||||
- **Add Cost Column**: Displays product cost alongside price for profitability analysis
|
- **Add Cost Column**: Displays product cost alongside price for profitability analysis
|
||||||
- **Clickable Product Links**: Product names and SKUs link directly to product edit page
|
- **Clickable Product Links**: Product names and SKUs link directly to product edit page
|
||||||
- **Clean Admin Interface**: Streamlined order view focusing on essential information
|
- **Clean Admin Interface**: Streamlined order view focusing on essential information
|
||||||
@@ -14,9 +15,10 @@ A Magento 2 module that customizes the order item columns in the Magento admin p
|
|||||||
|
|
||||||
### Column Modifications
|
### Column Modifications
|
||||||
|
|
||||||
**Removed Columns:**
|
**Removed:**
|
||||||
- Tax Amount
|
- Tax Amount column
|
||||||
- Tax Percent
|
- Tax Percent column
|
||||||
|
- Product thumbnail images
|
||||||
|
|
||||||
**Added Columns:**
|
**Added Columns:**
|
||||||
- **Cost** - Displays the product's cost attribute (positioned after price column)
|
- **Cost** - Displays the product's cost attribute (positioned after price column)
|
||||||
@@ -45,9 +47,9 @@ Add the repository to your Magento project's `composer.json`:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"repositories": {
|
"repositories": {
|
||||||
"module-order-items-custom": {
|
"module-admin-order-columns": {
|
||||||
"type": "vcs",
|
"type": "vcs",
|
||||||
"url": "https://code.shopkeeper.dev/McQueen/module-order-items-custom.git"
|
"url": "https://code.shopkeeper.dev/McQueen/module-admin-order-columns.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,8 +58,8 @@ Add the repository to your Magento project's `composer.json`:
|
|||||||
Then install:
|
Then install:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
composer require shopkeeper/module-order-items-custom:dev-main
|
composer require shopkeeper/module-admin-order-columns:dev-main
|
||||||
php bin/magento module:enable Shopkeeper_OrderItemsCustom
|
php bin/magento module:enable Shopkeeper_AdminOrderColumns
|
||||||
php bin/magento setup:upgrade
|
php bin/magento setup:upgrade
|
||||||
php bin/magento setup:di:compile
|
php bin/magento setup:di:compile
|
||||||
php bin/magento cache:flush
|
php bin/magento cache:flush
|
||||||
@@ -67,10 +69,10 @@ php bin/magento cache:flush
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# From your Magento root directory
|
# From your Magento root directory
|
||||||
mkdir -p app/code/Shopkeeper/OrderItemsCustom
|
mkdir -p app/code/Shopkeeper/AdminOrderColumns
|
||||||
# Upload all module files to app/code/Shopkeeper/OrderItemsCustom/
|
# Upload all module files to app/code/Shopkeeper/AdminOrderColumns/
|
||||||
|
|
||||||
php bin/magento module:enable Shopkeeper_OrderItemsCustom
|
php bin/magento module:enable Shopkeeper_AdminOrderColumns
|
||||||
php bin/magento setup:upgrade
|
php bin/magento setup:upgrade
|
||||||
php bin/magento setup:di:compile
|
php bin/magento setup:di:compile
|
||||||
php bin/magento cache:flush
|
php bin/magento cache:flush
|
||||||
@@ -88,6 +90,7 @@ After installation, the changes are automatically applied to all order views in
|
|||||||
|
|
||||||
You'll see:
|
You'll see:
|
||||||
- No tax columns
|
- No tax columns
|
||||||
|
- No product thumbnail images
|
||||||
- A new "Cost" column showing product costs
|
- A new "Cost" column showing product costs
|
||||||
- Clickable product names and SKUs that open the product edit page
|
- Clickable product names and SKUs that open the product edit page
|
||||||
|
|
||||||
@@ -124,7 +127,7 @@ The module uses Magento's plugin system (interceptors) to modify:
|
|||||||
### Module Structure
|
### Module Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
Shopkeeper/OrderItemsCustom/
|
Shopkeeper/AdminOrderColumns/
|
||||||
├── Plugin/
|
├── Plugin/
|
||||||
│ └── Order/
|
│ └── Order/
|
||||||
│ └── View/
|
│ └── View/
|
||||||
@@ -132,8 +135,16 @@ Shopkeeper/OrderItemsCustom/
|
|||||||
│ └── Items/
|
│ └── Items/
|
||||||
│ └── Renderer/
|
│ └── Renderer/
|
||||||
│ └── DefaultRenderer.php
|
│ └── DefaultRenderer.php
|
||||||
|
├── view/
|
||||||
|
│ └── adminhtml/
|
||||||
|
│ ├── layout/
|
||||||
|
│ │ └── sales_order_view.xml
|
||||||
|
│ └── web/
|
||||||
|
│ └── css/
|
||||||
|
│ └── order-items.css
|
||||||
├── etc/
|
├── etc/
|
||||||
│ ├── di.xml
|
│ ├── adminhtml/
|
||||||
|
│ │ └── di.xml
|
||||||
│ └── module.xml
|
│ └── module.xml
|
||||||
├── composer.json
|
├── composer.json
|
||||||
└── registration.php
|
└── registration.php
|
||||||
@@ -183,7 +194,7 @@ php bin/magento indexer:reindex
|
|||||||
|
|
||||||
3. **Verify module is enabled:**
|
3. **Verify module is enabled:**
|
||||||
```bash
|
```bash
|
||||||
php bin/magento module:status Shopkeeper_OrderItemsCustom
|
php bin/magento module:status Shopkeeper_AdminOrderColumns
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tax columns still showing
|
### Tax columns still showing
|
||||||
@@ -249,7 +260,7 @@ OSL-3.0, AFL-3.0
|
|||||||
|
|
||||||
## Version
|
## Version
|
||||||
|
|
||||||
1.0.0
|
1.1.0 - Added product thumbnail removal feature and renamed module to AdminOrderColumns
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "shopkeeper/module-order-items-custom",
|
"name": "shopkeeper/module-admin-order-columns",
|
||||||
"description": "Customizes order item columns in Magento admin - removes tax columns and adds cost column with clickable product links",
|
"description": "Customizes order item columns in Magento admin - removes tax columns, adds cost column with clickable product links, and hides product thumbnails",
|
||||||
"type": "magento2-module",
|
"type": "magento2-module",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"license": [
|
"license": [
|
||||||
"OSL-3.0",
|
"OSL-3.0",
|
||||||
"AFL-3.0"
|
"AFL-3.0"
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"registration.php"
|
"registration.php"
|
||||||
],
|
],
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Shopkeeper\\OrderItemsCustom\\": ""
|
"Shopkeeper\\AdminOrderColumns\\": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,13 +2,13 @@
|
|||||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||||
<type name="Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer">
|
<type name="Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer">
|
||||||
<plugin name="shopkeeper_order_items_custom"
|
<plugin name="shopkeeper_admin_order_columns_renderer"
|
||||||
type="Shopkeeper\OrderItemsCustom\Plugin\Order\View\Items\Renderer\DefaultRenderer"
|
type="Shopkeeper\AdminOrderColumns\Plugin\Order\View\Items\Renderer\DefaultRenderer"
|
||||||
sortOrder="10"/>
|
sortOrder="10"/>
|
||||||
</type>
|
</type>
|
||||||
<type name="Magento\Sales\Block\Adminhtml\Order\View\Items">
|
<type name="Magento\Sales\Block\Adminhtml\Order\View\Items">
|
||||||
<plugin name="shopkeeper_order_items_columns"
|
<plugin name="shopkeeper_admin_order_columns"
|
||||||
type="Shopkeeper\OrderItemsCustom\Plugin\Order\View\ItemsColumns"
|
type="Shopkeeper\AdminOrderColumns\Plugin\Order\View\ItemsColumns"
|
||||||
sortOrder="10"/>
|
sortOrder="10"/>
|
||||||
</type>
|
</type>
|
||||||
</config>
|
</config>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||||
<module name="Shopkeeper_OrderItemsCustom" setup_version="1.0.0">
|
<module name="Shopkeeper_AdminOrderColumns" setup_version="1.0.0">
|
||||||
<sequence>
|
<sequence>
|
||||||
<module name="Magento_Sales"/>
|
<module name="Magento_Sales"/>
|
||||||
</sequence>
|
</sequence>
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ use Magento\Framework\Component\ComponentRegistrar;
|
|||||||
|
|
||||||
ComponentRegistrar::register(
|
ComponentRegistrar::register(
|
||||||
ComponentRegistrar::MODULE,
|
ComponentRegistrar::MODULE,
|
||||||
'Shopkeeper_OrderItemsCustom',
|
'Shopkeeper_AdminOrderColumns',
|
||||||
__DIR__
|
__DIR__
|
||||||
);
|
);
|
||||||
|
|||||||
11
view/adminhtml/layout/sales_order_view.xml
Normal file
11
view/adminhtml/layout/sales_order_view.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!--
|
||||||
|
/**
|
||||||
|
* Remove product thumbnails from order items view
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||||
|
<head>
|
||||||
|
<css src="Shopkeeper_AdminOrderColumns::css/order-items.css"/>
|
||||||
|
</head>
|
||||||
|
</page>
|
||||||
11
view/adminhtml/web/css/order-items.css
Normal file
11
view/adminhtml/web/css/order-items.css
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Hide product thumbnails in order items view
|
||||||
|
*/
|
||||||
|
.order-tables .col-product .product-image {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Adjust product info spacing when thumbnail is hidden */
|
||||||
|
.order-tables .col-product .product-sku-block {
|
||||||
|
margin-left: 0 !important;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user