How to move block generated by magento extensions in the layout? - php

We're using a magento extension to deal with back to stock notifications (Ebizmarts MageMonkey). This is generating a block in our product pages, when the product is out of stock.
Problem is, the block end up at the end of the main column of the product page, when we would like it to be in the right column of the page.
So, the question is, is there a clean way to move where a block generated by a magento extension (be it MageMonkey or any other) is displayed in a page WITHOUT changing the extension code ? Is there something i can do with a layout.xml file to change where it display, or is it tied to the extension itself ?
I'm still a beginner with magento, so i may be missing something.
Thanks in advance.

You need to enable your template path hints. To do this go to
System --> Configuration --> Developer --> Set template path hints to yes.
If you refresh the page you will see red blocks around your layout components. Find the lay-out block you want to move and open the file (probably a .phtml file). In there you will find something like this:
echo $this->getLayout()->createBlock('cms/block')->setBlockId('my-block')->toHtml();
Cut out that piece of code and place it anywhere you want it.

Related

Unable to add header for the website in header.tpl using OpenCart

I tried adding header in header.tpl and it is not reflecting in the front end where i did the same for my test website and it was coming fine,can you please suggest a way to edit and tell me if something is required to change in any other header.php files
In your admin panel, go to Extensions > Modifications and hit "Refresh" (the blue icon in the top right corner of your page).
This process must be done every time you change something in a core file.
Changing OpenCart's core files is not a great idea, though.
I highly recommend using OCMOD to write your modifications.

Editing / customising Cart blocks in Magento 1.8.1

Hi I am trying to move some of the blocks around on the cart page, and have looted in loads of files and cant seem to find what I am looking to edit.
I want to reorganise the 5 blocks that display under the list of what is actually in the cart.
I have a Template Path Hints so I can see what blocks are there and where they are located, but I am beginning to wonder if this is more complicated than I first thought.
Does anyone have any suggestions on how I can tydy up this part of the page?
Please follow following steps-
1- find layout file in magento theme checkout.xml.
2- Find block name which you want to move.
3- Use insert after/before magento XML tag to move these blocks accordingly.
Note: kindly backup your files before editing.

How to edit an opencart footer?

I'm presuming I have to edit the footer through mysql, I haven't done this website, a colleague who has decided not to come back into work has put this together http://tandgwebdesign.co.uk/ashleafarmshop.co.uk/ and it's using the Journal 2 theme, however, usually I would edit the footer through the footer.tpl, or even in the admin panel, however I can't fathom a way of editing the "FREE DELIVERY ON ALL ORDERS OVER £80" and the few lines of text below.
Could anyone help me out and tell me how to edit this through MySQL? It's an OpenCart website, or is there any easier way to do it?
The footer is stored in a file called footer.tpl in the following folder:
catalog/view/theme/YOUR_THEME_NAME/template/common/footer.tpl
Check the footer's <h1> tag and see if you can edit the text there. If there's only a variable there, then I guess it stored in a language file (catalog/language/YOUR_LANGUAGE/common/footer.php).

Unable to Display Products in Magento

Our client is using custom search i.e., Searchperience at present they want to remove the custom search and enable the default magento search. While removing AOE_Searchperience related folders Products are not displaying at all. How can be this solved?
Perhaps you have not removed all the files and there is an XML file that is pointing to a template that doesn't exist.
Are you concerned with the category page or the product page or both?
If everything is displaying on the category page except the products then I suggest you add a quick echo('products would be here'); as the first line of code in the file /app/design/frontend/[your theme or base]/catalog/product/list.phtml
if you can see that string in your shop you know you have identified the correct phtml file and you should check to see if the product collection is populated.
if you do not see the string then you need to work out which list.phtml is being called by Magento. I would search my files for list.phtml but turning on Magento's system->configuration->developer->debug->template path hints (and add block names to hints) will expose which .phtml file is being called and what its block class is - that will help you flesh out if the wrong .phtml file is being used or if it is of the wrong class.
If the correct list.phtml is being called but the product collection is empty then there is something funny going on.
To remedy Magento behaving funny:
log out of the admin area and log back into the admin area
turn compilation off
turn compilation back on
re-index everything
refresh all the Magento caches including the Magento cache and the cache storage
refresh any external caches
try to refresh the page and see if that helped.
If that didn't help, switch to the default Magento theme and repeat the steps above. If the product still aren't there even in the default theme then it suggests there are still some module files getting in the way or maybe the core files have been changed but that would be very odd. Start with the .phtml and the block class (discerned from the debug hints mentioned above and follow the code back until you figure out why the category page has an empty product collection)
If the default Magento theme does display the product then you know your fault is theme specific so turn your theme back on and study the file local.xml very very carefully.

Magento - Customizing a page?

I just started using Magento, and to me, it seems like a big mess in there...
I'm looking to edit my home page that I got from a template. It looks great but I took out a bunch of useless static blocks inside of it and now I have wholes everywhere. Check the link:
http://goo.gl/v5uTx
What I don't seem to find is where is my actual page structure? I went into the admin and just found this for my home page:
<p>
{{widget type="flexiblewidget/list" column_count="3" limit_count="9"
if="em_feature_product=1" header="Favorite products" order_by="name asc"
template="flexiblewidget/featured.phtml"}}
</p>
Which is basically a tiny part of the page.
So the question is, where can I find the rest of my page content and structure (ie the slideshow, the top offers, ...) so that I can try to re-organise it to look like a website and not cheese?
Thanks.
Magento is different than most other CMS solutions. You may be used to seeing the raw HTML in the CMS page, or at least a good portion of it. However, Magento uses PHP to render blocks onto the page. It gets it's instructions from XML documents inside of your theme. If this is your first time working with Magento, it may be good to check out this post before you get too frustrated. It will walk you through some basics.
Most likely, the HTML for your slider and top offers are in files inside of your theme directory. Your theme directory will be at app/design/frontend/PACKAGE/THEME/ - your php and html will be in the template folder, and the XML instructions will be in the layout folder. The home page, like many other pages on your site are using a main template to load site-wide HTML and CSS. There are 4 of these main templates by default: 1 column, 2 columns with left sidebar, 2 columns with right sidebar, and 3 columns. These main templates can be found in the templates folder under the "page" directory. If you open one of these templates, you will find a line that looks like this:
<?php echo $this->getChildHtml('content') ?>
This line is asking the XML instructions for anything under the block named "content". That is most likely where the slider is being assigned. You will have to find the XML file this is being defined in. You may want to familiarize yourself with the layout folder and Magento's fallback hierarchy. Check out this post.
Hopefully this will help you out with the issues you're having with your page!

Categories