A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [custom-block]

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

46 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
11
votes
1answer
975 views

Magento2: Conditionally replace block template and class the right way

This rather trivial requirement turns out be quite a pain for us in recent days, as we couldn't find a satisfying existing solution, yet. The Task We are trying to replace certain blocks with a ...
3
votes
0answers
34 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, ...
3
votes
0answers
46 views

Load products page inside phtml page Magento 2

I have a custom .phtml page, and i want to insert products page which contain layered navigation like this: so i already have filtered product collection, is there a chance to do call this products ...
2
votes
1answer
695 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://...
2
votes
0answers
72 views

Magento2 : Problem in block creation

I try to modify the template of a custom option type in backend, sales order view section. In this page, product options are not displayed using a dedicated template, but only by returning Html of ...
2
votes
1answer
246 views

Help create a block to insert view.phtml

Help create a block to insert view.phtml. I have a layout file that outputs to buy in one click in the right column. I need to put this block alongside a buy button. <checkout_cart_index> &...
1
vote
1answer
25 views

Exception in Magento log: the element can't have a child

I found the following errors in the exception.log and debug.log files in /var/log folder: [2019-12-17 16:23:05] main.CRITICAL: The element "product.info.options" can't have a child because "product....
1
vote
1answer
30 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
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->...
1
vote
1answer
86 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
76 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 ...
1
vote
2answers
1k 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
1answer
97 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 ...
1
vote
1answer
584 views

Block is not calling properly in magento 2 custom module

I have a custom theme in magento 2 website. In home page i called a banner slider(Banner_slider is a custom module) I called the slider like this in home_content.phtml(design/frontend/company/...
1
vote
1answer
492 views

Display Polls with a custom template shows only empty results

Meta Magento 1.9.2.1 Custom Template Poll works fine when in sidebar Poll works fine when loaded by layout xml History Based on this information: http://inchoo.net/magento/magento-frontend/...
1
vote
2answers
1k views

Magento2: Calling upsell block from phtml is not working.

I want get up-sell product block. when I am working with XML script block is working. but when I am trying to this in .phtml file it's showing nothing .I do not what is wrong with .phtml and XML data ...
1
vote
0answers
474 views

Conditionally Add Body Class Within Module Block?

I'm currently adding a body class in my module's default.xml but I can't (to my knowledge) conditionally add it within the XML file based on the module's configuration values. See this question - ...
1
vote
3answers
736 views

Directory of custom block in magento 2.1

I create a file custom block php. Directory is: app\design\frontend\Vendor\default\Magento_Theme\Block\CustomBlock.php CustomBlock.php: class CustomBlock extends \Magento\Framework\View\Element\...
1
vote
3answers
157 views

Custom Block Product List Injection failed

I have to display a list of product on the product view, depending on its sku. In order to do that, i have simply pasted the Random.php list example of Magento_Catalog. But in order to find the ...
1
vote
0answers
294 views

getOrder() doesn't return Mage_Sales_Model_Order when debugging

I try to var_dump($order) but it gives me : object(Varien_Object)#290 (7) { ["_data":protected]=> array(0) { } ["_hasDataChanges":protected]=> bool(false) ["_origData":protected]=> NULL ["...
1
vote
1answer
400 views

Add Child block to particular widget

For my project i do want to add child block to particular widget. Widget is being added via CMS Page. i want to add child block to that widget. Is it possible ? Magento 1 or Magento 2 any answer ...
1
vote
1answer
451 views

Troubles overriding core block

I am having troubles overriding one of magento's core blocks. The one I am interested with is Wishlist. Module's default location is app/Core/Mage/Wishlist. I tried following the instructions I've ...
0
votes
1answer
32 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
147 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
0answers
65 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\...
0
votes
1answer
114 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 ...
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, ...
0
votes
0answers
438 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
335 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
1answer
451 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 ...
0
votes
2answers
552 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: ...
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 ...
0
votes
1answer
456 views

Call third party module block in CMS page in magento 2

Is there any way to insert custom block in CMS page in Magento 2.2 alike inserting CMS block in CMS page?
0
votes
1answer
78 views

Custom block on product page if product is out of stock / in stock

I want to add two custom blocks on product page - one to be displayed if product is in stock and the other one if product is out of stock.
0
votes
2answers
713 views

Invalid block type while accessing the custom block (Magento 2)

Error in magento 2.0.11 while accessing custom block Invalid block type: Tomrain\Appcustomizer\Block\Customizepage #0 /var/www/html/appcustomizer-tshirt-M2/vendor/magento/framework/View/Layout/...
0
votes
2answers
878 views

Magento 2 Invalid Block Type in Custom Module?

How can I Rectify Invalid Block Type Error in my custom module. I created a custom module in magento 2 for overriding default product list page with separate phtml file I am calling them in category ...
0
votes
0answers
21 views

html not appearing

Below code is working fine in product/media.phtml $_saleLabelHelper = $this->helper('custom_catalog/salelabel') echo $_saleLabelHelper->getSaleLabelHtml($_product); But the same code is not ...
0
votes
1answer
42 views

How to refer to no named block in Magento 2

I have block: <block class="Magento\Backend\Block\Widget\Grid\Column" as="name"> <arguments> <argument name="header" xsi:type="string" translate="true">Title</...
0
votes
1answer
193 views

Block not rendering

In my backend controller I use the following code to render a custom block. $this->_title($this->__('Inventar')); $this->loadLayout(); $this->_setActiveMenu('...
0
votes
1answer
379 views

Minicart items count update

I'm using this extension: Ajax Cart Popup It works fine, but there is a problem of updating items counter which renders together with mini cart icon in the header. With original developers help on ...
0
votes
1answer
78 views

How Magento process block defined inside layout xml?

I have strange situation where block defined in xml is not loaded. Everything is properly defined and it works on more than 500 stores. It is simple layout file like this: layout.xml <?xml ...
0
votes
1answer
549 views

Load textarea attribute in product page via custom block

I'm trying to show an attribute in product page. I have create my .phtml file with the bellow code. <?php $_prodID = Mage::registry('current_product')->getId(); $_product = Mage::...
0
votes
1answer
278 views

Why? Can't call custom file phtml to list.phtml?

In controller .... $this->_initAction(); // $this->loadLayout(); $update = $this->getLayout()->getUpdate(); $update->addHandle('default'); $this-&...
0
votes
1answer
856 views

How to override or extend Product List Page template to show Icon on Product Images in Magento Extension

Consider the Below Image I want to show an Icon on the Image of each product. I am developing an extension and I want to do this task via that extension, independent of theme. How can I achieve this ...