Questions tagged [custom-block]

The tag has no usage guidance, but it has a tag wiki.

Filter by
Sorted by
Tagged with
1
vote
1answer
27 views

How to add custom fee block in total block checkout?

I have two custom modules. One is onestepcheckout and another is for a custom fee. I need to add a customs fee block into the onestepcheckout. Thanks in advance.
1
vote
3answers
68 views

How to add a custom block within checkout cart summary in magento 2

How to add a custom block within checkout cart summary in magento 2
0
votes
2answers
58 views

Magento 2: How to add PHP code into CMS Block using .phtml file

I have followed the below links to try and get PHP code into CMS Block which links to a .phtml file, with no avail. Show content of phtml file on static block Magento 2 PHP code in Block Currently ...
0
votes
1answer
31 views

Magento2: Add Custom table next to Product attribute in Product Detail Page

How to add Custom table next to product attribute in a product detail page
0
votes
0answers
8 views

How to display a custom block inside a group of atributes en Magento 2 backend

I need to display a custom block inside a group of atributes in Magento 2 backend. I follow this guide: magento 2 - How to create a custom "admin" block and display it on an existing Admin ...
0
votes
4answers
104 views

Magento 2 Custom query to display selected product in Custom block

I have some product ids . Currently I can display products in category using {{block . But now I am developing a custom block in app/design/frontend/Alothemes/bencher6/Magento_Theme/templates/myphp/...
0
votes
0answers
32 views

Magento 2.3 Alter Custom block title

Trying to alter the text from Custom Block to Shipping & Payment, cant seem to find it anywhere, Using Magento 2.3 Im using etheme-shopy as my template, the static block to alter the text is ...
0
votes
1answer
51 views

Magento 2 : Face Error while create a custom block

I got the below error when create the Custom Block for the HTML sitemap. Error filtering template: Warning: Declaration of Vapor\Sitemap\Block\Sitemap\Category::_getHtml(Magento\Framework\Data\...
0
votes
1answer
108 views

Magento 2.3 add custom block under each product in category page

I need to overwrite the product listing (category) page, a custom form needs to show after that product information. So I have found that already an extension is overwriting that page as below <...
0
votes
1answer
42 views

Convert Magento 1 Script to Magento 2 (Get Order ID by custom Block)

I am trying to get the ORDER ID, BaseSubtotalInclTax, BaseShippingInclTax, and TaxAmount on the success.phtml page by using custom block. On Magento 1 I had to put the following script in the success....
1
vote
2answers
41 views

Display custom block on Homepage

I have a problem with custom module and displaying custom block template on homepage. I create a custom module to show product form specified category. my config.xml file: <config> <...
0
votes
0answers
55 views

Magento2: Custom module block rendered twice

I have made a custom module. But block rendered twice. My local system is working fine. But on Production is getting the error. Anyone help me with this. Controller <?php namespace Codism\...
3
votes
2answers
102 views

Magento2: Custom module not working

I have created new module but it is not working.Please Help me on this. registration <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\...
0
votes
1answer
88 views

Not able to disable block cache without affecting Magento FPC

I have created a custom block where I am showing the number of items in the cart and also loggedin the customer name. I am getting correct count and customer name on checkout page.But not on any other ...
1
vote
0answers
23 views

Magento2: Block Controller Issue

When I call to controller first time showing my data on page after some seconds data not showing on page. page is showing blank. Controller public function execute() { $itemid = $this->...
0
votes
1answer
23 views

Magento2 How can i create block on popup with product details?

I want to show product details on popup using controller. So how is it possible? $htmlCatInfo = $layout->createBlock( \Tigren\Ajaxcart\Block\BuildProductInfo::class, ...
1
vote
1answer
37 views

How I can add custom block to layout using php in Magento 2

I have created a custom block, as I want to add this layout to my current layout. Following is my block: <referenceContainer name="sidebar.main"> <block class="Vendor\ModuleName\...
1
vote
2answers
41 views

Magento2: Block not created from controller

How to create block from controller by ajax method? $result = $this->resultJsonFactory->create(); $resultPage = $this->_resultPageFactory->create(); $block = $resultPage->...
1
vote
1answer
42 views

Block not appearing when giving custom type

I am trying to nest one block inside another block but the child block isn't showing when I set custom block type. If I set both blocks as page/html then both blocks show fine: <?xml version="1.0"...
3
votes
0answers
33 views

How to show full product page on home (but show different custom block than product page)

I have a one product store in Magento 2, and want to make it easy to order as soon as possible. So i want to have on the homepage everything that there is on the product page, like order button, ...
0
votes
1answer
45 views

How to add custom block with image

Add custom images div like this sample app block. How can we create it for our custom theme ?
0
votes
1answer
39 views

Add custom block to layered navigation - best to Price

Is anyone know how I can add custom block to price filter in layered navigation? I curently moved my block with jQuery, but what if someone add more attributes? Maybe I could add class to price ...
0
votes
1answer
446 views

Pass the value from the block class to the phtml file and not working in custom module

Hi all I need your help, I am writing a new module (quote request, when user go to the product details page, they can request a quote for the product) I created a form and display in the product ...
0
votes
0answers
389 views

Magento 2.3 - Extend layout to add new custom block after existing block from another module

What I hope to accomplish is adding a new option to an existing menu of options in category edit page, specifically adding a new option below the "Match products by rule" switch toggle. This menu is ...
0
votes
1answer
21 views

How to get Magento 2 product image on custom phtml by product id Without loading product collection

I need product image on custom phtml in magento 2. Product is collection is a array not object. I just want to product product_base_image , without loading product collection. I tried <?php ...
0
votes
1answer
309 views

Getting “Invalid block type” exception on Magento 1.9.3.7 for custom template inside catalog/product

I am facing a strange issue. I am getting "Invalid block type" exception for a custom block that I have created. I am using the block like this {{block type="example/menu" name="product.menu" ...
0
votes
3answers
1k views

Magento2: How to call custom block in phtml file

I have created a custom block page. I want to call custom block to another phtml file. When I called custom block in xml file is working. But when I called custom block in phtml file is not working. ...
0
votes
1answer
391 views

Magento 2 Custom Module Controller getLayout , createBlock, getBlock , append Fatal error:

namespace My\Module\Controller\Index; use Magento\Framework\App\Action\Context; class Index extends \Magento\Framework\App\Action\Action { protected $_resultPageFactory; public function ...
2
votes
4answers
541 views

Move Custom tab at top of left sidebar customer dashboard

I want to move my custom tab from bottom to top in customer dashboard left sidebar. I tried below thing <referenceBlock name="customer-account-navigation-account-link" remove="true"/> &...
0
votes
1answer
87 views

Magento2: Custom block data not showing on frontend side

I have created a simple module. But block data not display front end. please find the below code Block <?php namespace Codism\Csr\Block\Index; class Additional_Csr extends \Magento\Framework\...
1
vote
1answer
82 views

How to create page with left sidebar In magento 2.1.15?

I want to create page or block with sidebar. if I click customer service then I want to see customer service info etc. 2nd Image : 3rd Image:
1
vote
0answers
74 views

Magento 2, Dynamic add or refresh block in sale order page

Using Magento 2, Sale-Order, Block info + history. How to refresh block in sale order page after summit comment successful. In image below I need refresh "block comment preview" after block comment ...
3
votes
2answers
70 views

Block fails on (live) server but works on localhost?

I've added a custom block to catalog/product/view.phtml using echo $this->getLayout()->createBlock('colorchart/colorchart')->setTemplate('colorchart/colorchart.phtml')->toHtml(); and it's ...
3
votes
1answer
588 views

Magento2 not getting post data from ui component phtml file

I have implemented admin form using UI component. In that, I have 3 separate tabs. Among 3, I have displayed one tab using custom phtml file by using following code in ui component form xml file <...
1
vote
3answers
1k views

How to add a custom block after product info in product view page magento2?

How to add a custom block in product view page after product info. I have created a custom block via admin and its id is category-block-1 I have a custom them and i tried override catalog_product_view....
1
vote
2answers
926 views

How to create a custom Widget with custom conditions

I need to create a custom widget using custom conditions to show a product list in the home page. I have to show the option to add multiple inputs in the widget form to set conditions that I need. ...
1
vote
2answers
313 views

Magento2 - accessing helper in controller

I have helper class that has constructor that takes following parameters: Context, Cart, Session, CollectionFactory. It derives from \Magento\Framework\App\Helper\AbstractHelper. I would like to use ...
2
votes
1answer
59 views

Block is not shown on custom page

I am a new in Magento. I have installed Magento 2.2. and created 1 module with custom page. There is 1 block on this page, which has to be shown on it. But it is not shown. Please, help me to resolve ...
2
votes
1answer
198 views

Pass multiple variables to view

We can pass a variable to a .phtml view file like this: $currentTime = date("H:i", time()); $someValue = 123; $this->loadLayout(); $this->getLayout() ->getBlock('newsletter_popup') ...
0
votes
1answer
323 views

How to display the current time in .phtml with caching enabled?

I created a really simple block in my child theme: /Magento_Theme/layout/default.xml: <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" name="...
0
votes
1answer
64 views

Error in getting block in a template

I am a magento beginner and need help with creating a new custom block. Basically, I just want the block to show "hello" if it is called. Module installation xml file, app/etc/modules/...
0
votes
2answers
519 views

Magento custom block not showing on frontend

I'm trying to create custom block to show some info on the page, but got some weird issue that this block not showing. Already broke my brain by trying to debug why. There are some code snippets: ...
2
votes
3answers
112 views

Create block between header and main

I am facing issue with creating a block between header.container and main. so that I can put the banner over there. And I need the banner in home page only please help me for the same.
2
votes
1answer
666 views

Add phtml to Customer Account Edit in Adminhtml

I tried to add phtml to customer account edit in backend like this: app/code/Namespace/Module/view/adminhtml/layout/customer_index_edit.xml <?xml version="1.0"?> <page xmlns:xsi="http://...
1
vote
1answer
33 views

Adding a preview product section on the product page

I am fairly new to the Magento platform so excuse my lack of knowledge! I'm working on a Magento 2 project. I need to add a preview section for my products. Ideally, it would be between the product-...
0
votes
1answer
169 views

Setting custom data for block in layout

I'm trying to set some custom data for my block in local.xml: <cms_index_index> <reference name="after_body_start"> <block type="core/template" template="custom.phtml"> ...
1
vote
1answer
1k views

Add custom block in Magento 2 admin dashboard

Is there any way to add a custom block in magento 2 admin dashboard? I have a requirement to add custom table in dashboard. Can anyone help me? My current magento version 2.2.1
0
votes
0answers
33 views

Magento 2, adding block to a template which does not have xml file

I need to add below block (my custom moudule) to <referenceContainer name="content"></referenceContainer>strictly, but the target template (third-party module) is created via plugin and ...
1
vote
1answer
1k views

Add block to cart summary in magento 2

How can i add custom text block into cart summary?
1
vote
1answer
1k views

Adding a new block to a Product detail page above Add to Cart block

So I'm trying to add a block to the product page. The block will simply output an attribute if it exists for that particular product. In this case it is outputting the bottle size. Now I've got the ...