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.

Filter by
Sorted by
Tagged with
3
votes
3answers
3k views

Magento 2: Get all category products by category name

anyone knows how to load from my custom block.php all the products of a specific category, I would like to get them by the name of the category and not by the id. I tried to change the standard ...
0
votes
1answer
2k views

Disable page cache for a single block

I have created a new block to sit on the product detail page which contains dynamic content (the customer's recently-viewed products) that should not be cached. How can I switch off caching for that ...
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
872 views

Overriding Sales\Block\Order\View Block in Magento 2

I am trying to extend Magento\Sales\Block\Order\View by using preferences to get some more information into customer order view page. Everything works fine if i remove __construct. so what might be ...
1
vote
1answer
54 views

CE1.9.2 - Custom Menu - Replace Layout block

I've just written a small custom menu module for a site I'm working on, and need it to replace the current base/default catalog.topnav. My module's config.xml looks like this: <?xml version="1.0"?&...
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('...
1
vote
1answer
305 views

how to add html in ordered item section in admin panel? [duplicate]

I just want item id after every item so I could create some buttons get some information from database but it is always showing id of first item this is my xml <layout version="0.1.0"> <...
2
votes
2answers
2k views

Function call returning fatal error: Call to undefined function getRecentProducts()

Hi I am a newbie to magento. I'm trying to call a custom module block using getChildHtml() function which unfortunately is showing a fatal error: Call to undefined function getRecentProducts() I am ...
1
vote
1answer
682 views

Is this the correct way to add a custom block to before_body_end only on homepage?

Working with Magento CE 1.9.1.0. I have written some custom code which I have placed here: app/design/frontend/mypackage/mytheme/template/page/html/custom_code.phtml I also created a new XML ...
0
votes
1answer
145 views

Upgrade to 1.9.2.4 duplicating block in footer

I have created static blocks in CMS then added them to the footer of RWD theme and everything had been working great. I just upgraded files to 1.9.2.4 via Magento Connect Manager and now one block is ...
0
votes
2answers
462 views

Block rendering issues in Magento 1.9.2.0

having some weird issue in Magento 1.9.2.0 I've got my local.xml file: <?xml version="1.0"?> <layout> <catalog_product_view> <reference name="root"> &...
0
votes
1answer
380 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
79 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::...
3
votes
2answers
5k views

Magento2 loading admin layout and template in a new page

I can't get my head wrap around this. I have this controller namespace Vendor\Gift\Controller\Adminhtml\Gift; use Magento\Backend\App\Action\Context; class Index extends \Magento\Backend\App\...
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
4answers
124 views

Magento 1.9.x - Blocks not being displayed from local module

I am creating a module to add some extra call to action buttons. I cannot get an output to display. I believe I am getting either the naming conventions or the file location (or both) wrong. It may ...
9
votes
2answers
2k views

$product->getOptions() returns empty result

I am trying to get product details including product custom options value in a custom block i created.This is the code i used on product detail page and it worked there, but when trying to use it on ...
0
votes
1answer
611 views

Magento2 - Error: Can't find custom block

I've created my custom extension and tried to install it. Now I get the following error: PHP Fatal error: Class 'My\Module\Block\Customer\Form\Register' not found in /var/www/html/magento2/lib/...
2
votes
2answers
5k views

Calling to custom block from cms page display blank page

I've created a custom block, however when calling the block from cms page displays nothing. Even the content of cms page does not displat that is above the call to custom block Here is How i'm ...
1
vote
2answers
5k views

Get Product Collection based on brand parameter from cms page

I'm creating custom block to get products based on the brand name I'd like to pass the brand name parameter from the cms page like below {{block type="core/template" template="catalog/brand/...
1
vote
1answer
409 views

How to render custom blocks in product general description field

I've created a template in template/catalog/product/view/ which displays a products image, title, sku and view info button. I've done this so that I can add suggested items into my 'description' area ...
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 ...
0
votes
2answers
306 views

Magento custom module phtml inside another custom module phtml block

I have Magento 1.9 ce website with two modules installed. One for Ajaxlogin in popup in all pages including homepage and another for Facebook Connect Login. Now AjaxLogin popup is called in local....
0
votes
1answer
607 views

How to get Object of custom block?

I have created a Block class as this class Sb_AddressManager_Block_Address_Edit extends Mage_Customer_Block_Address_Edit {....} and its path is /www/abc/app/code/local/Sb/AddressManager/Block/...
0
votes
1answer
64 views

Inject custom block in custom position into checkout page

I'm stuck with injecting a block from my module into checkout page. The problem is that I need my block be inserted right before closing <body> tag, this is "before_body_end" position, as I know....
1
vote
1answer
2k views

Magento 2 RC - Invalid block type

I created an extension for Magento on Magento 2 1.0.0 beta. Now I'm trying to get this extension working for Magento 2 RC, but I can't figure it out. What I have is a very simple extension that ...
0
votes
2answers
2k views

How to add new products block to the product view page using local.xml

I'm trying to add a new products block to the product view pages, I have several products marked as new & they DO show up on the homepage, for some reason they won't display on the individual ...
1
vote
1answer
3k views

Adding custom block to catalog product view

I'm currently making my own module, but i'm having trouble with just displaying a block in the catalog product view. I've added this line to default/layout/catalog.xml <block type="catalog/...
0
votes
1answer
2k views

changing position of quantity block in product page

I am trying to change the position of quantity block in product page. I was trying to create a new quantity module named qty.phtml in /product/view folder and linked it in view.phtml using the ...
-1
votes
2answers
2k views

How to call a custom layout update handle in catalog.xml?

I need a custom page that uses a lot of methods from an existing block class. For the beginning I created a new layout update handle in the catalog.xml: <catalog_category_secretpage> // some ...
0
votes
2answers
674 views

How to connect my custom block to the layout

So there's one piece of the custom block puzzle I'm not really getting. What I'm trying to do: I want to use $this->getChildHtml('customBlock') inside my header.phtml file and have it just print '...
1
vote
2answers
591 views

how to add the block from other xml file

I have a custom xml file which has the block which i am targeting and it is productalert.xml as fallow: <catalog_product_view> <reference name="content"> <reference name="...
0
votes
1answer
116 views

Move custom block immediate after nav

I created custom block on category page to show category title full width after menu. For that I created one xml code on local.xml of theme layout file. <catalog_category_default> <...
3
votes
1answer
2k views

Custom Block (Slick Slider) Not Working

Trying to add a Slick(http://kenwheeler.github.io/slick/) slider to homepage. It looks simple enough, but I have been banging my head against the wall for the last 2 days. Here's what I have done: ...
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 ...
7
votes
3answers
11k views

Custom Block “Invalid Block Type”

I have a custom Block which I'm now trying to break into two sepparate blocks. Here's my folder structure (on app/code/local/MyNamespace/CustomerDashboard): Since I want to break the functions of ...
3
votes
2answers
682 views

Change $this to different block in related.phtml

I am working in related.phtml in app/design/frontend/[package]/default/template/catalog/product/list/. Here there is a foreach loop: <?php foreach($this->getItems() as $_item): ?> which loops ...
1
vote
1answer
2k views

Adding a block to a specific location

I'm trying to insert a block that shows up at a specific point in my page. I created a new layout file, which looks like this: mylayout.xml <layout version="0.1.0"> <catalog_product_view>...
1
vote
2answers
2k views

Custom block duplicating Product View using local.xml

I'm trying to add a new block to the Product View page using my local.xml file, within this file I have the following: <catalog_product_view translate="label"> <reference name="content"&...
0
votes
1answer
521 views

Custom product collection on product page displays vertically (need it horizontally) [closed]

Please advise, I have a custom block named "sizes" to display on product page collection of similar products with another sizes. It is located in app/design/frontend/default/my_theme/blocks/sizes....
3
votes
3answers
2k views

How to pass a variable from a.phtml Block to its parent block?

I've created a child block and inside there is a counter. Now I need that value from the counter but the output is/shall before my block. Is that possible? It shall look like this: html output the ...
0
votes
1answer
77 views

Display custom blocks in magento error?

I am trying to do custom blocks in magento, for that i have created a cms page called Testpage, and inside the URL Key, i have given c-integration i think this seems to be block id, and status is ...
0
votes
2answers
1k views

Custom module's block doesn't show up - xml layout file 'type' issue?

Block created inside custom module doesn't show up in the fron-end. Namespace: Fmat Module: FtPrices Custom Block file: Fmat/FtPrices/Block/Product/View/Tierprices.php custom block php file: <?...
0
votes
1answer
632 views

loading custom .phtml template using custom block

I am trying to load a custom .phtml template using custom block. But the template isn't loading. I saw similar problems here and tried to figure out a solution, but couldn't find out where the problem ...
4
votes
1answer
550 views

Access block function in model

In my custom module, I have perform some logical calculations in block to get the value in frontend. And also I need to get that value in model also. So my question is, I call the block function in ...
0
votes
2answers
1k views

Add Customize Compare Product to Customer Account Page

I'm new to magento, and I'm struggling with this problem. I want to add Customize Compare Product to Customer Account Page, so i created my customize block in \template\catalog\product\compare\...
0
votes
1answer
14k views

getLayout()->getBlock('') returns false in contoller file

I want to show product grid serialization in admin in my collections module. But i am getting error of Fatal error: Call to a member function setCollectionsProducts() on a non-object by ...
1
vote
1answer
345 views

How to create a layout block

I'm trying to create one simple thing: Block which is referred by the layout file. But I spend a two hours and still couldn't detect where am I wrong. Here is the config.xml: <?xml version="1.0"?&...
0
votes
2answers
770 views

Inserting Open Graph tags via custom module and block

I'm using Magento EE 1.6 When I use a custom block class to display some tags inside my <head>, block won't display. But if I use the "page/html" type, everything is fine... I need my custom ...