In Magento, by default, the sales order items for configurable products are showing the parent product SKU. How can we show the child product SKU for configurable products? I have tried changing the code in the function at vendor/magento/module-sales/Block/Adminhtml/Items/Column/DefaultColumn.php public function getSku() { return $this->getItem()->getSku(); } to public function getSku() […]
Magento1
Magento 2.4.6 I am trying to get an orders surcharge amount which was added by the Fooman Surcharge extension. In Magento 1 it worked with $order->getFoomanSurchargeAmount();, in Magento 2 it doesnt work this way. Any ideas how to get the amount from an order object? Thanks!
I am trying to move the top.links to the header-wrapper as in the picture in order to create some fancy icons instead of just text links. I was able to do that adding this line to the default.xml file on my custom theme. <move element="header.links" destination="header-wrapper"/> But when i do […]
1 exception(s): Exception #0 (MagentoFrameworkConfigDomValidationException): Element ‘move’: This element is not expected. Line: 1427 Exception #0 (MagentoFrameworkConfigDomValidationException): Element ‘move’: This element is not expected. Line: 1427
I hava created an observer with this event file. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_order_save_after"> <observer name="purchase_sales_order_place_after" instance="MaxselPurchaseOrderObserverSalesOrderSaveAfter" /> </event> </config> and this is the observer file * @var LoggerInterface */ protected $logger; /** * @param ResourceConnection $resourceConnection * @param LoggerInterface $logger */ public function __construct(ResourceConnection $resourceConnection, LoggerInterface $logger) { $this->logger […]
I have a custom controller with this code: use MagentoFrameworkAppActionHttpGetActionInterface; use MagentoFrameworkAppResponseHttpFactory; use MagentoFrameworkAppResponseInterface; use MagentoFrameworkControllerResultInterface; use MagentoFrameworkExceptionNotFoundException; use MagentoFrameworkViewElementTemplate; use MagentoFrameworkViewResultPageFactory; class Entries implements HttpGetActionInterface { public function __construct( private Navigation $navigation, private readonly PageFactory $resultPageFactory, private readonly HttpFactory $httpResponseFactory ) { } /** * Execute action based on […]
Is it possible to add a new tab in the admin product edit page, but just for simple products? I was able to add a tab using ui_component, but I can’t figure out how to add this just for simple products view/adminhtml/ui_component/product_form.xml <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd"> <fieldset name="new_tab"> <argument name="data" xsi:type="array"> […]
I added ‘custom_field’ to ‘customer_entity’ table by using ‘db_schema.xml’ file and need to save ‘some value’ in it then I wanted to filter the collection by ‘custom_field’ value. How can I achieve this ? When I use the below code. $customer = $this->_customerFactory->create(); $customerData = $customer->getCollection()->addAttributeToFilter('custom_field',array('neq'=>'cleared'))->setOrder('entity_id','ASC')->load(); I am getting this […]
I am trying to create new product attribute of type datetime. Attribute is created successfully and also there is no error while reindexing. Note – I am able to save the attribute value from admin panel. But while sorting I am getting below error – No mapping found for [added_on_value.sort_added_on] […]