Categories
CMS Magento Mastering Development

Adding a tab to customer information in Magento 2.3.5

I’m trying to add a tab to the customer information section in the admin from my custom module. For some reason it is not adding the tab Here is my view/adminhtml/layout/customer_index_edit.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_form"> <block class=" XX\XX\Block\Adminhtml\Customeredit\Tab\View" name="customertab_panel"> <arguments> <argument name="tab_label" xsi:type="string" translate="true"> Custom Tab Label</argument> <argument name="sort_order" xsi:type="number">100</argument> </arguments> […]

Categories
CMS Magento Mastering Development

Magento 2 – Call to a member function addAttributeToFilter() on null

I am working on a module for a customer that is designed to generate a category link to the main artist page for the product. I’ve created a module that’s designed to get the category IDs of the artist categories then the categories of the current product. Afterwards, it compares the arrays for a matching […]

Categories
CMS Magento Mastering Development

Magento 2 admin form save button not working in custom module

Magento 2 i have created admin grid and form. when i am trying to add new data save button not working add new->new form ->save and continue , save both not wokring below is my code <?php namespace MagePsycho\Customshipping\Block\Adminhtml\Zipcodes; use Magento\Backend\Block\Widget\Form\Container; class Edit extends Container { /** * Core registry * * @var \Magento\Framework\Registry */ […]

Categories
CMS Magento Mastering Development

Display custom canonical URL on category page in Magento 2

I’ve created a module to add a custom category attribute (custom canonical URL) to a category page. The attribute displays in the admin and I can save the value. I’ve extended _prepareLayout() function of \Magento\Catalog\Block\Category\View but it doesn’t seem to be working. I’m I missing something or is there a better way to do this? […]

Categories
CMS Magento Mastering Development

Call current product in custom phtml file in Magento 2

On the product page I created a custom module to override the form.phtml file. I also added the option to include a new file called customFile.phtml when the user clicks on a button that is positioned under the product description. In this customFile.phtml file I am trying to retrieve the current product data but it […]

Categories
CMS Magento Mastering Development

Admin Block Form Edit File Than The Choose File Was blank and re upload the file at edit time?

Here is my form admin edit See here choose file was blank when we edit the image here is my edit file code Controller\Adminhtml\banner\Edit.php <?php namespace Vrinsoft\Banner\Controller\Adminhtml\banner; use Magento\Backend\App\Action; class Edit extends \Magento\Backend\App\Action { /** * Core registry * * @var \Magento\Framework\Registry */ protected $_coreRegistry = null; /** * @var \Magento\Framework\View\Result\PageFactory */ protected $resultPageFactory; /** […]

Categories
CMS Magento Mastering Development

Admin Block Form Edit File Than The Choose File Was blank and re upload the file at edit time?

Here is my form admin edit See here choose file was blank when we edit the image here is my edit file code Controller\Adminhtml\banner\Edit.php <?php namespace Vrinsoft\Banner\Controller\Adminhtml\banner; use Magento\Backend\App\Action; class Edit extends \Magento\Backend\App\Action { /** * Core registry * * @var \Magento\Framework\Registry */ protected $_coreRegistry = null; /** * @var \Magento\Framework\View\Result\PageFactory */ protected $resultPageFactory; /** […]

Categories
CMS Magento Mastering Development

Admin Block Form Edit File Than The Choose File Was blank and re upload the file at edit time?

Here is my form admin edit See here choose file was blank when we edit the image here is my edit file code Controller\Adminhtml\banner\Edit.php <?php namespace Vrinsoft\Banner\Controller\Adminhtml\banner; use Magento\Backend\App\Action; class Edit extends \Magento\Backend\App\Action { /** * Core registry * * @var \Magento\Framework\Registry */ protected $_coreRegistry = null; /** * @var \Magento\Framework\View\Result\PageFactory */ protected $resultPageFactory; /** […]

Categories
CMS Magento Mastering Development

Review form – dynamic rows

I need to add dynamic rows to review form, the problem is that the form is not defined in xml, but in php class \Magento\Review\Block\Adminhtml\Edit\Form, i cannot find how to add dynamic rows via php, please help. Thank you in advance! /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license […]

Categories
CMS Magento Mastering Development

registry product returns null

My phtml file is extended with this class: class Select extends \Magento\Catalog\Block\Product\View\Options\AbstractOptions { protected $_escaper; public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Pricing\Helper\Data $pricingHelper, \Magento\Framework\Registry $registry, \Magento\Catalog\Helper\Data $catalogData ) { $this->registry = $registry; parent::__construct($context, $pricingHelper, $catalogData); } private function getCurrentProduct() { if (is_null($this->product)) { $this->product = $this->registry->registry(‘product’); if (!$this->product->getId()) { throw new LocalizedException(__(‘Failed to initialize product’)); } […]