Skip to content

Set Custom Field Data in the Order

I created a observer : <?php namespace VendorModuleObserver; use MagentoFrameworkEventObserver; use MagentoFrameworkEventObserverInterface; use MagentoFrameworkAppRequestInterface; use PsrLogLoggerInterface; class SaveRefToQuote implements ObserverInterface { protected $logger; protected $request; /** * Constructor * * @param LoggerInterface $logger * @param RequestInterface $request */ public function… Read More »Set Custom Field Data in the Order

Hide Products in ProductCollection => Problem with Pagination and Filters

I would like to hide some articles in a certain category. So far I have solved this using a plugin: di.xml: <type name=“MagentoCatalogModelLayerCategoryCollectionFilter”> <plugin sortOrder=“1” name=“Vendor_Modulename::aroundProductCollection” type=“VendorModuleNamePluginCatalogCollectionFilter”/> </type> <?php namespace VendorModuleNamePluginCatalog; use MagentoCatalogModelLayerCategoryCollectionFilter as CategoryCollectionFilter; use MagentoCatalogModelResourceModelProductCollection as ProductCollection; use… Read More »Hide Products in ProductCollection => Problem with Pagination and Filters

“quantity_and_stock_status” attribute is not functioning as expected on the product list page in Magento 2.4.6-p3, Enabled usage in product listing

I recently encountered an issue with the Magento default “quantity_and_stock_status” attribute. While this attribute is functioning properly on the product view page, it’s not working on the product listing page even after enabling the “used_in_product_listing” setting in the backend. On… Read More »“quantity_and_stock_status” attribute is not functioning as expected on the product list page in Magento 2.4.6-p3, Enabled usage in product listing

Magento 2: Image not uploading in grid “Attention: File was not uploaded”

Created a custom module using Ui_Component,facing problem during image upload. Error (On alert) : Attention: File was not uploaded Ui_Component Form Code for Upload: <field name=”icon”> <argument name=”data” xsi:type=”array”> <item name=”config” xsi:type=”array”> <item name=”dataType” xsi:type=”string”>string</item> <item name=”source” xsi:type=”string”>Item</item> <item name=”label”… Read More »Magento 2: Image not uploading in grid “Attention: File was not uploaded”

Magento 2 Check if url returns 404

I have ann Array of urls $arr = Array( ‘http://magento2.com/url-exist’, ‘http://magento2.com/url-does-not-exist’, ‘http://magento2.com/url-does-not-exist’, ‘http://magento2.com/url-exist’); I’ve tried curl, get_headers they all failed output is wrong: <a href=”http://magento2.com/url-exist” >Link-1</a> <a href=”http://magento2.com/url-does-not-exist” >Link-2</a> <a href=”http://magento2.com/url-does-not-exist” >Link-3</a> <a href=”http://magento2.com/url-exist” >Link-4</a> It should return only url… Read More »Magento 2 Check if url returns 404