How to call block function in template file.

<?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’];?>

Published
Categorized as 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 :

Published
Categorized as Magento

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?

Published
Categorized as Magento

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

Published
Categorized as Magento

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?

Published
Categorized as Magento

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.

Published
Categorized as Magento