Magento category view next and previous page toolbar - magento

Whomever worked on the site previous me has somehow turned off the toolbar on the category view page. They had wanted to get rid of the filter by, and other options.
Now we have too many products to display them all on one page, so I went ahead and limited it to show 12 products, which it does. But now navigation shows up. I assume this is because of how they turned off the toolbar. Where do I find the code (using a theme) to control this toolbar? I am hoping they just commented out the code.
Magento 1.9.3.3

there is also a possibility to remove toolbar in layout xml.
most common place for this would be local.xml of the Theme
app/design/frontend/[theme]/layout/local.xml
can also be done in any other xml (like catalog.xml) in
app/design/frontend/[theme]/layout/
simply search for product_list_toolbar block and actions like remove or unsetChild

over ride the below given files into your theme
app/design/frontend/base/default/template/catalog/product/list.phtml
and you can see the code that call child html of tool bar
in line numbers 42 and 125 for bottom side
<?php echo $this->getToolbarHtml() ?>
so if you commented this line then corresponding tool bars not shows
or if you want to customize the tool bar part then you can edit in the file.
app/design/frontend/base/default/template/catalog/product/list/toolbar.phtml
this file is render for toolbar

Related

Why does my MVC component for Joomla 3 have an empty sidebar?

I am changing my Joomla 2.5 component into a Joomla 3 component. However, it turned out to be one big obstacle course with hardly any documentation for it as far as I could find...
In Joomla 3 (using 3.5.1 at time of writing) the originally horizontal submenu goes vertical into the sidebar.
I called JHtmlSidebar::addEntry( "Item", "index.php?option=com_example", false ) to add a submenu item. Then called echo JHtmlSidebar::render() in the view's template file.
I do get a sidebar that can be opened and closed, but there are no items in it...
I downloaded the Hello World example component from https://docs.joomla.org/J3.x:Developing_an_MVC_Component/Adding_an_install-uninstall-update_script_file. It has a sidebar but it's a mess: in its Messages view there is a sidebar with items in it but not the collapsable one and in its Categories view the collapsable one appears empty and over the other sidebar:
It also uses JSubMenuHelper (instead of JHtmlSidebar), which is deprecated...
I then tried to find out how it is done in Joomla's core com_installer, which has a nice collapsable sidebar with submenu items, but did not find more than what I already described above...
Anyone who can tell me how to get a proper sidebar? Thanks a lot already!!
And as it is so often: just after I posted my question I found the answer...
In admin/controller.php I defined a method addSubmenu() in which JHtmlSidebar::addEntry() is called. I called addSubmenu() from the method display(), but I accidentally did that after calling parent::display(), so no entries where added yet when that method was executed.
Now calling addSubmenu() before calling parent::display() and getting a very nice sidebar as result.

Magento widget rendering in non-CMS content

Is there a simple way to hook into the Magento widget rendering feature on something other than CMS block or page?
I have a tooltips extension to display tooltips on custom options. There will be lots of products all with the same options and all needing the same tooltip text. While the tooltip extension we're using provides a means to declare snippets that can then be used on products, the snippets are added to individual products at setup time rather than referencing the single snippet instance. Thus if the tooltip content needs to change across all products we have to edit the snippet and then reapply the modified snippet to all products.
It would be preferable to be able refernce the snippet direct rather than just using it at product setup, but that's not how it works. So an alternative would be to include a static block in the tooltip description and reference the single description instance with our theme's already provided widget feature that works for on CMS pages e.g. {{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="xx"}}, where xx is the block created for this tooltip.
This needs the tooltip HTML description parsed through whatever it is in Magento that parses content HTML and processes any widget directives it contains.
I tried the following, where $tipstext is the tooltips HTML containing the widget directive, but no go. Didn't think it would be that simple!
Mage_Cms_Model_Template_Filter::filter($tipstext);
Anyhone have any idea if/how this could be achieved easily?
The class Mage_Cms_Model_Template_Filter does not have a widgetDirective method so it does not know how to parse {{widget}} short codes. Try instead Mage_Widget_Model_Template_Filter:
Mage::getSingleton('widget/template_filter')->filter($text);
This should work
<?php
$filter = new Mage_Widget_Model_Template_Filter();
$_widget = $filter->filter('{{widget type="cms/widget_page_link" template="cms/widget/link/link_block.phtml" page_id="2"}}');
echo $_widget;
?>

How to locate a block that is used by Magento, but isn't displayed in the admin panel?

I've inherited a Magento shop site, and the previous developer has gone AWOL. So I'm left with a sheet of paper essentially telling me how to do basic things such as changing the banner on the home page. That's pretty much it.
The person who owns the page now wants to change an advert that's held on the right hand side on the product pages. I've searched in the Admin panel under CMS and drawn a blank. I've navigated through the template files and I've found the 3 column HTML file that I thought contains the actual advert.
It doesn't. Instead, it has the following code:
<div class="col-right sidebar"><?php echo $this->getChildHtml('right') ?></div>
Where can I find the Child HTML? I've searched all of the folders for the file that I'm assuming is called "Right". But I can't seem to find it.
Anyone know where something like this could or would be held?
That is the absolute most root function, anything that is placed in the child "right" will be displayed here and is most certainly not where you want to be doing your editing.
There are literally a hundred different ways content could be posted here and what I would recommend to start with is first determining if it is a static block or a template file.
Go to System -> Configuration -> Developer.
Change "Current Configuration Scope:" to the store you are currently troubleshooting.
Find your IP and place it in "Allowed IPs (comma separated)", this way the next steps will only be visible to you.
Under the "Debug" section you should now see "Template Path Hints" enable this and reload the page.
If that block now has something like: "app/design/base/default/catalog/product/view.phtml" you know it is in a phtml file and you can go there. If it doesn't:
It could be a banner, go to CMS -> Banners and check there.
It could be a static block, go to CMS -> Static Blocks
It could be...any number of things.
You stated that it is on the product page, next step is check catalog.xml in your layout folders. Search for and see if anything inside of there makes sense about what it could be. If the previous developer was any kind of proficient it won't be in catalog.xml but in local.xml OR a custom module's .xml file in the layout directory of the custom theme.
Try doing a search on the code base for the content inside of the block and see if anything pops up. If nothing, use phpmyadmin to search the database for some of the content.
Hope this helps a little.
Search for:
<reference name="right">

Joomla 1.5 / Modification of YooTheme "ZOO" Component

I'll start out by mentioning that there is a developer forum for Zoo and I have used it already. My purpose posting here is that I typically get a thorough answer within minutes or hours at SO, whereas the responses on dev forums can be slow or non-existent due to the smaller population base.
My question regards Yootheme's ZOO 2.3.2. By default, a product "Frontpage" appears to have a "Categories" box rendered on top of the items. If one turns off all the available options in Frontpage/Template configuration (hide Titles, Count, Descriptions, etc.), an empty box still remains on top of the items.
I've been able to manually remove the box in its entirety by addressing the following file:
media/zoo/applications/product/templates/default/frontpage.php, and commenting out lines 84-92:
<!-- <?php
// render categories
if ($this->category->childrenHaveItems()) {
$categoriestitle = $this->application->getParams()->get('content.categories_title');
echo $this->partial('categories', compact('categoriestitle'));
}
?> -->
Seems like there should be a more eloquent way of doing this on the admin backend, but I couldn't find one. Am I missing something or is my solution the best one?
ZOO is designed to easily be able to modify the built in templates to suit your needs. ZOO templates are meant to be overridden much like Joomla uses template overrides. Rather than editing the default template, you simply create a new template that does what you want it to. The default template should not be changed.
Here is the documentation on ZOO templates - http://www.yootheme.com/docs/home/item/create-a-new-template
Rather than edit the file you mention above, you make a new template here -
media/zoo/applications/product/templates/YOUR-TEMPLATE-NAME/frontpage.php
Then do all the changing you want without messing up the default.
There is an easier way: First, you must identify what calls the item called "frontpage". In PURE yootheme at least it is called from "home" in the "mainmenu". So click "home" buton of the mainmenu, then over the right menu "Parameters(Basic)" you just chose "-select aplication-" instead "frontpage" and that's it.The Frontpage and its "box" are now gone. At least it works for me.

Which file should I edit to change the breadcrumbs starting point?

I wanted to change the breadcrumbs starting point from Home to My title. I edited the file /magento/app/code/core/Mage/Catalog/Block/Breadcrumbs.php but it doesn't seem to be working. Is XML playing a role in that?
thanks
Your best option is to use Magento's translate feature. Notice how the text in Breadcrumbs.php is wrapped with ->__('text') which instructs Magento to see if there is a translation for text for the current module. If you turn on Translate Inline in System>Config>Admin>Developer, you will be able to edit the text on the page (after refreshing, click the red box then the little book icon). This will then be entered into the database in the core_translate table and replaced in future page renders.
As a general rule, you should never edit files in app/code/code as you will break future upgrades and patches.
turn on Translate Inline in System>Config>Admin>Developer, you will be able to edit the text on the page (after refreshing, click the red box then the little book icon)

Resources