Files
module-admin-order-columns/Plugin/Order/View/ItemsColumns.php
shopkeeperdev fbc0d17cae 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>
2025-11-11 09:06:37 -05:00

31 lines
766 B
PHP

<?php
namespace Shopkeeper\AdminOrderColumns\Plugin\Order\View;
class ItemsColumns
{
/**
* Modify the columns array to remove tax columns and add cost column
*
* @param \Magento\Sales\Block\Adminhtml\Order\View\Items $subject
* @param array $result
* @return array
*/
public function afterGetColumns($subject, $result)
{
// Remove tax columns
unset($result['tax-amount']);
unset($result['tax-percent']);
// Add cost column after price
$newColumns = [];
foreach ($result as $key => $value) {
$newColumns[$key] = $value;
if ($key === 'price') {
$newColumns['cost'] = 'Cost';
}
}
return $newColumns;
}
}