<?php$blockObj= $block->getLayout()->createBlock(‘JJ\Paymentinformation\Block\Main’);$data= $blockObj->getMyCustomMethod();?> And which block u want call in that div add <p class=”cash-amount”><?=$data[‘credit-limit’];?>
Category: Magento
Disable Cache for Category TopMenu
Updates from NS to the category header or name will not be worked on the real-time so for that, the layout should be having cacheable false setting. We can achieve the option in the following method.Create a custom module for the changes app/code/VendorName/ModuleName/registration.php app/code/VendorName/ModuleName/etc/module.xml app/code/VendorName/ModuleName/etc/di.xml app/code/VendorName/ModuleName/Block/Html/Topmenu.php
How select button is visible on the Magento admin side?
In the XML file, we need to add the following code. example in which file this should be added, Homepage->ImageUpload->view->adminhtml->ui_component->homepage_imageupload_image_listing.xml And in BannerActions.php Screenshot :
How to get product collection by product SKU in Magento 2?
You can get product data by product SKU in Magento 2 by below code snippets, <?php namespace Rbj\Training\Block; class Product extends \Magento\Framework\View\Element\Template { /** * Constructor * * @param \Magento\Framework\View\Element\Template\Context $context * @param array $data */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Api\ProductRepositoryInterface $productRepository, array $data = [] ) { $this->productRepository = $productRepository; parent::__construct($context, $data); } /** *… Continue reading How to get product collection by product SKU in Magento 2?
How to write HTML code inside
You can do like HTML in PHP : Or You can write like. PHP in HTML : <?php /*Do some PHP calculation or something*/ ?> Means:You can open a PHP tag with <?php, now add your PHP code, then close the tag with ?> and then write your HTML code. When needed to add more PHP, just open another… Continue reading How to write HTML code inside
How to get data from the database table by MySQL query in Magento?
Add bundle Items with a checkbox option to cart programmatically
Here we are checking the product type and adding the product to the cart programmatically based on the bundle item as the checkbox item.
How to Resolve Incorrect Captcha settings in store front?
Steps to Configure a Storefront CAPTCHA in Magento 2 Please follow these steps to complete enabling a CAPTCHA at the storefront: On the Admin panel, click Stores. In the Settings section, select Configuration. Select Customer Configuration under Customers in the panel on the left Open the CAPTCHA section, and continue with following: In the Enable… Continue reading How to Resolve Incorrect Captcha settings in store front?
Add custom column filter in customer grid collection in Magento 2
STEP 1Create a di.xml file inside the app/code/Vendor/Module/etc/ directory. And add the below-mentioned code in this file. STEP 2 Create Collection.php file inside the app/code/Vendor/Module/Model/ResourceModel/CustomerGrid/ directory.
Install stripe issue resolved
Issue- solution- In project folder vendor folder delete ->again create a vendor folder copy the htaccess file from magento vendor folder and paste in to the project vendor folder. Then open composer json file delete the svddevelopment line composer update ->upgrade->deploye then stripe is installed.