Using Object Manager,
Category: Magento
Printing a JSON array from Magento 2.4.4
Usually, the JSON can be printed using a simple logger but from Magento 2.4.4 onwards this will not print the array. For that, we have to use $logger->info(print_r($params,true)); (print_r($jsontobeprinted, true)) Var_dump can be also used for printing the contents in the variable.
:: Before,:: after properties not supporting in input type in Mozilla firefox.
:before and :after should only work on the element which can act as a container of content. <input> cannot contain any content so it should not support those pseudo-elements. Chrome supports it because it does not follow the spec (or bug?). Reference : https://stackoverflow.com/questions/37653706/before-with-input-in-firefox
Magento 2 Getting Image URL for template files and CMS Blocks.
Just a quick note on how to get image URLs in both template files and cms blocks for Magento 2. For template files: Images in Vendor/theme/Vendor_Module/web/images or app/code/Vendor/Module/view/frontend/web/images/ or if images are in Vendor/theme/web/images/ For CMS Static Blocks or Pages: Images in Vendor/theme/Vendor_Module/web/images or app/code/Vendor/Module/view/frontend/web/images/ or if images are in Vendor/theme/web/images/
how do I change the position of the date picker/ calendar icon in HTML and CSS without using bootstrap
CSS commands
Creating User Role in Magento
User Roles Login to Magento 2 admin panel Go to System > Permissions > User Role Click the “Add New Role” button Select Role Info under role information Enter the descriptive role name Enter your password under Current User Identity Verification Go to Role Resources under Role Information Set resource access to custom Select the resource checkbox that the… Continue reading Creating User Role in Magento
How to design a dashed border using CSS ?
border: dashed 2px #707070 ; border-style reference: https://kovart.github.io/dashed-border-generator/
How To Show Company Field In Magento 2
Log in to Admin Panel. On the Admin Panel sidebar, go to Stores > Settings > Configuration. In the left panel, choose CUSTOMERS > Customer Configuration. Expand the Name and Address Options section. Untick Use system value and set Show Company to “Optional” or “Required”. Click Save Config when complete. You can see the company field displayed in the Address Book. And display on Checkout Form.
Generate PDF programmatically in Magento2
we can apply the following code according to our requirements in any file, i.e. block, controller, model, helper, etc. <?php namespace Company\Module\Controller\Index; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; class Index extends Action { /** * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $fileFactory; /** * @param Context $context */ public function __construct( Context $context, \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->fileFactory =… Continue reading Generate PDF programmatically in Magento2