Skip to content

magento man

How to make custom customer attribute filterable in the customer grid?

I’ve made a patch and this is the code for creating my customer custom attribute: public function apply() { $this->moduleDataSetup->getConnection()->startSetup(); /** @var CustomerSetup $customerSetup */ $customerSetup = $this->customerSetupFactory->create([‘setup’ => $this->moduleDataSetup]); $customerEntity = $customerSetup->getEavConfig()->getEntityType(Customer::ENTITY); $attributeSetId = $customerEntity->getDefaultAttributeSetId(); $attributeSet = $this->attributeSetFactory->create(); $attributeGroupId… Read More »How to make custom customer attribute filterable in the customer grid?

Product Filter Count Showing Wrong Count After Custom Product Collection – Magento Layered Navigation

I have applied custom filter on product collection to hide certain products from listing page. I have used below event for same <event name=”catalog_product_collection_load_after”> <observer name=”abc_productrestriction_collectionfilter” instance=”AbcProductRestrictionObserverFrontendCatalogCollectionFilter” /> </event> and in the observer, I am removing the product from collection… Read More »Product Filter Count Showing Wrong Count After Custom Product Collection – Magento Layered Navigation

Jslayout in adminhtml area

I have custom menu item created in “Content” named AskQuestion. Apparently, there is controller and routing for it. All left to do is to make jslayout output some simple text. How do I do this?

Magento 2: Create order programmatically using carrier containing underscore (PostNL)

I am unable to create an order programmatically with the carrier PostNL. The carrier code is “tig_postnl” and the method “regular”. Normally I set the shipping address simply using: $shippingAddress = $quote->getShippingAddress(); $shippingAddress->setCollectShippingRates(true) ->collectShippingRates() ->setShippingMethod(‘freeshipping_freeshipping’); (for full code please see… Read More »Magento 2: Create order programmatically using carrier containing underscore (PostNL)