Questions tagged [blocks]

denotes questions about the `Block` classes.

Filter by
Sorted by
Tagged with
0
votes
1answer
13 views

I have created a custom module for backed to add menu and submenu but it shows me on phtml file in Magento 2

I have created a custom module for back end Menu and sub menu but it shows me an error for phtml file. 1 exception(s): Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template ...
0
votes
1answer
33 views

I have created a custom module for backed to add menu and submenu but it shows me Error?

I have created a custom module for back end Menu and sub menu but it shows me an error. 1 exception(s): Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: '...
1
vote
1answer
52 views

How to Show Static CMS block in Magento 2 html file?

I want to Show Static CMS block in Magento 2 html file.
0
votes
1answer
34 views

How to show Content Blocks in HTML File in Magento 2

I have created a custom tab in Magento 2 in which the html part is shown by HTML file. Means its extension is (.html). I want to show some blocks in that html file how would i do that.. Infact i have ...
0
votes
0answers
13 views

is creating block within template in magento 2 good practice

I often see in phtml templates blocks being creating dynamically like below: $block->getLayout()->createBlock(BlockClass)->toHtml(); I worry whether this is good practice and particularly ...
0
votes
1answer
10 views

Insert a custom block into another custom block, in Magento 2

I have a block in my homepage site which has a div with a pair of banners. I've created a new block only dedicated to my 2 images that I want to insert into my homepage block. Is that possible? How ...
0
votes
1answer
31 views

Magento 2 Create Controller With No Theme?

Is it possible to create a controller with Magento 2 that doesn't have the admin menus/navbars? Essentially I want the page to return just the HTML I write and not put anything else? I considered just ...
1
vote
1answer
20 views

How to get second field value from data base based in first field id in magento2 admin block form?

here i get the layer id in drop down now i have get layer type in second field in based on layer is select can any one help me how can i do that.i try $fieldset->addField( 'layer_id', ...
1
vote
1answer
39 views

Create New Module get 404 error(How to debug code)

Hello, I have create new custom module and run frontend get 404 Page error. How to debug module what problem in code ? Please Help me. THANKS.
1
vote
0answers
12 views

Move block after size atributte of product page [Magento 2]

I want to move a block and put it after size attribute because when I click this button magento detect that I add to cart: I use this to move after add to cart, but I don´t known to move to the other ...
1
vote
1answer
26 views

How To Add Fixed Filter In Custom Admin Block Grid in Magento 2?

Here is my custom grid i wan to show only those data that status is paid but now the data present with paid and unpaid both . how can i set default filter to these custom block grid... here is my ...
1
vote
0answers
11 views

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\...
0
votes
0answers
12 views

Get Custom Field on Category Template

I've added a custom field to the database and admin category page. I'm calling the following in my categories.xml (and it works but it is not displaying the custom field) <block class="...
1
vote
2answers
26 views

Magento 2 : <referenceBlock name=“checkout.cart.coupon” remove=“true”/> being ignored

If I comment out <block class="Magento\Checkout\Block\Cart\Coupon" name="checkout.cart.coupon" as="coupon" template="cart/coupon.phtml"/> in E:\Projects\...
1
vote
0answers
20 views

Block class does not exist

I've been failing, trying to add a custom block to my module. I got the error message : Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid type of block: Cpy\...
1
vote
0answers
14 views

Contact page disappear after save category

I have a online store in Magento 2.2.3 with i18n stores. In menu i create new Catalog Category with name: Contacts, Contactos and Contacts in order EN, PT and FR. I configure this category to redirect ...
0
votes
1answer
90 views

Hide CMS static block programmatically in Magento 2

I need to Hide static cms block "block-id-1" from frontpage programmatically customer group based. I need to add event to hide cms static block or any other method. I want to use admin ...
1
vote
2answers
56 views

How to pass Data from a UI Component Form to a Controller?

Hey I'm beginner at Magento 2, and i don't know to much about UI component... I'm creating a register form, and i want to pass Data of a UI Component Form to a Controller. So i have a Form and i got a ...
0
votes
0answers
25 views

How to display login on hover in magento 2

In this i want to create a custom module in that one button is in header for login and on hover of that button i want to display login form with ajax.
0
votes
0answers
26 views

Magento 2.3.4. Product Description tab is missing

I am using a custom theme by Swissup on my Magento store. The code that used to get all the product related tabs is $block->prepareTabsData() Strangely enough, this is now returning all the tabs ...
0
votes
1answer
22 views

Pagination in Custom Collection magento 2

I am retrieving data from third party as an object, I am forcefully converting an object into array and collection. I want to apply pagination with the data, I tried using core pagination logic and ...
0
votes
0answers
17 views

Help Following guide

I'm trying to integrate Google Address to magento, following this guide But I dont understand a line in php, here's the block definition: namespace Webkul\Autofill\Block; use Magento\Framework\View\...
0
votes
0answers
13 views

Display my block after product grid in list.phtml

I am overwriting list.phtml via catalog_category_view.xml file now I want to move my custom block after grid, can anyone tell me how can I do it? <referenceBlock name="category.products.list" ...
0
votes
1answer
18 views

Can we overwrite list.phtml and catalog_category_view in multiple modules?

Well I am vcery new to Magento, I have a module where I have already overwritten catalog_category_view.xml and list.phtml can I use the same file with other changes in other modules if Yes how?
0
votes
0answers
12 views

Product Collection incorrect no of products count after applying filters

I have extended ListProduct class into my custom module like this: di.xml <preference type="Ktpl\QuickShop\Block\Product\ListProduct" for="Magento\Catalog\Block\Product\ListProduct"/> ...
0
votes
0answers
17 views

Magento 2 - Call form to Create new Customer in Adminhtml

I am trying to create a custom module where my company needs the ability to create a new customer from Adminhtml without leaving the page. I figured loading the form into a modal with ajax would be ...
0
votes
0answers
13 views

magento 1.8 /checkout page

I have a question to ask, hope anyone can help me My store magento 1.8. There is a page: https://www.lieblingstaschen.com/checkout But there is only a image. And I can edit the image in a block. I ...
0
votes
0answers
10 views

How to update addItemRender action through layout file for changing the template in Magento 1.9

I have this piece of code in my custom theme in layout file: <default> <reference name="header"> <block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/...
0
votes
0answers
18 views

How to show only Product Name and price in specific category magento 2

I am working on specific category so I need to show some customized changes in that for that I need to show only product Name and price and by clicking on that I have continued button I am confused ...
0
votes
1answer
17 views

Add Custom block and changes for specific category

I have created the category and added my custom code in that, I have also my custom block which I created for that I have used catalog_category_view.xml file but it affects in all other my category ...
0
votes
1answer
25 views

Magento 2.3: How do I retrieve the product price in form.phtml file and assign it to an HTML attribute data-purchase-amount?

How do I retrieve the product price in form.phtml and assign it to an HTML attribute data-purchase-amount ="" as code snippet meant for Klarna tagline placement as seen in the file below. <div ...
0
votes
1answer
69 views

Magento 2: Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: Perfectmirrors\PmmLayout\Block\Head

I am really not sure how to create the block class Pmm\PmmLayout\Block\Head , function of which $block->getAllPagesJSContent() should be called inside my phtml file pmm_head.phtml <...
0
votes
1answer
64 views

How to remove cache from my Block class?

I need to remove the cache from my Block class, even if it removes the cache from the entire page. How could I do it?
0
votes
0answers
9 views

Magento 2.3.4 - Blank page with login block after login

I have added the following block to the Page: {{block class="Magento\Customer\Block\Form\Login" name="customer_form_login" template="Magento_Customer::form/login.phtml"}} But after the login, the ...
0
votes
0answers
21 views

Blocks changing order on mobile

I created 2 blocks using the magento UI block creator. I then went to the pages area and used the "add block" function to add the blocks to the page. In Desktop, they show up the way that I added ...
1
vote
0answers
19 views

How to control block XML cache via admin?

I've created a condition in my admin panel to enable or disable a feature in my module. In my XML I used the ifconfig to check if it's enabled or disabled. I want to disable the cache in the entire ...
0
votes
0answers
11 views

Nesting Pruduct details default block in my custom block

I would really appreciate a hand here - thanks in advance for any tip, I'm fairly new to Magento's layout structre. I've created a custom block via backend. In that block, among other things, I would ...
0
votes
0answers
15 views

Admin Add a New Button in Form Container which send form to other controller

In magento 2 Admin i have create a form using a NON UI component method that is using block classes. I wanted to submit this form to two different controller. By default it sends data to save ...
-1
votes
1answer
20 views

Error when extending the Magento\Catalog\Block\Product\ListProduct::class

I tried to extend the Magento\Catalog\Block\Product\ListProduct::class like this : namespace Vendor\Module\Block\Product; class ListProduct extends \Magento\Catalog\Block\Product\ListProduct { ...
1
vote
0answers
48 views

Error add new block into block Magento 2

I'm using Magento 2.3.4 and t tried to append a block to another block like this in my controller: $category_list_subcategories = $resultPage->getLayout()->getBlock('promotion.view....
0
votes
2answers
37 views

Error getting Block in controller Magento 2: Element 'block', attribute 'class': [facet 'pattern']

I'm trying to get block in my frontend controller like this: $resultPage = $this->resultPageFactory->create(); $breadcrumbs = $resultPage->getLayout()->getBlock('breadcrumbs'); this is ...
0
votes
0answers
20 views

PHTML receives no response from the Ajax Controller

In order to be able to load the product list according to the customers' selection, I tried to use an Ajax query. However, I have the problem that I do not receive the response from my controller. The ...
0
votes
1answer
38 views

How to add button at top of Layered navigation Filter from custom module?

I have a phtml that contain button like this in my custom module : app/code/Vendor/Module/view/templates/button.phtml <button> <span> <?= __('New Button') ?> </span> </...
0
votes
0answers
18 views

cloning xml block or move block only for mobile

can anyone please help me how to duplicate the block sidebar block 'red box' in the first picture to mobile navigation like all the links in the sidebar 'red box' in first picture will be replace ...
0
votes
1answer
23 views

Dynamically generated block identical for all clients - Why?

I use PHP to create the content of a block dynamically on a CMS page (created via the admin portal). But I found out during testing that the first generated block remains active for all clients until ...
0
votes
1answer
39 views

Magento 2 - new container not showing in overriden layout file

I try to change the layout vendor\magento\module-catalog\view\frontend\layout\catalog_product_view.xml in my own theme. I have overriden the layout file completly: app\design\frontend\company\base\...
2
votes
1answer
36 views

Add a custom/programmed block to a CMS page

I have created a page using the CMS (via Admin Portal) and now I want to add a custom block (programmed) to the page. You can see the created page here: My structure is the following: but ...
0
votes
0answers
8 views

magento 2 duplicate category products page layout with all blocks and style?

I have a category page where all products for the particular are listed. For ex: https://local.mysite.com/women.html I want show all my products for a particular brand on different page like, https:/...
0
votes
0answers
6 views

how to filter the magento 2 in admin invoices list based on customer email?

how to filter the magento 2 in admin invoices list based on customer email ? i try to core modules but its not working?
0
votes
1answer
25 views

How to add global container fo all my actions using layout block magento2

i want to add a global select like 'Select one option' contains my all actions 'Renew' and 'View' , can anyone tell me how to do that ? This is my code for now I have done some effort but 'Select one ...

1
2 3 4 5
35