Questions tagged [custom-block]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
26 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
38 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
49 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
35 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
37 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
47 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\...
2
votes
2answers
75 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
37 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
22 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
32 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
35 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
27 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
37 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
157 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
311 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
19 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
246 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
0answers
318 views

Magento 2: How to show review form in a custom block

I have removed the review tab. I wish to add review form in custom block. Please provide me a solution to show review form in a custom block. Please provide me a solution in magento 2
0
votes
3answers
681 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
236 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
448 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
61 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
59 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
61 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
66 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
482 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....
0
votes
2answers
753 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
240 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
54 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
186 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
257 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
63 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
403 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
97 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
529 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
98 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
966 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
31 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
977 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 ...
0
votes
1answer
4k views

how to set custom template in custom block file in magento 2 [duplicate]

How to set custom template in custom block file. I have created a template which contains paragaraph. I need to set this template in my block file . So What is the syntax to set template. I have ...
3
votes
1answer
805 views

How can I insert block before breadcrumbs or just after menu on every page?

I would like to add block to the website (in general on every page) just below menu but not into header, "root" eventually "content". I managed to add it into content but it's not what I wanted. => ...
2
votes
1answer
2k views

Programmatically create and append a block to another block

I've declared a plugin that creates and adds a block programmatically if a condition is true. However, my code outputs nothing, it's like if the created block is not rendered at all. etc/di.xml <...
0
votes
2answers
416 views

Magento 1.9.3 calling a custom block in cart page unsuccessful

I have a very basic module: app/code/local/Demo/Custom/Block/Giftproducts.php class Demo_Custom_Block_Giftproducts extends Mage_Core_Block_Template { public function getGiftProducts() { //...
1
vote
1answer
88 views

Magento Irregular caching of my custom block

I have created a custom block to display 10 random products on my homepage, and for load time etc, it is a bad idea to request random products from the database each load. Thus, have incorporated the ...