I'm working in a default/default theme in Magento 1.9.3.2.
I would like to make a custom module that adds to categories of products(placed at the top menu) new subcategory called "View All" that displays all products from a given category, i.e.:
Category: Woman
Before:
Subcategories: New Arrivals, Tops & Blouses, Pants & Denim, Dresses &
Skirts
After:
Subcategories: View all, New Arrivals, Tops & Blouses,
Pants & Denim, Dresses & Skirts.
I have got a very similar problem to this one: How to make "view all" link in topmenu with sub categories but I don't really know how to approach this problem anyway.
What steps (starting from scratch) should I take to achieve my goal?
I would be grateful for any help.
1 Answer
You can take help from below file:
app/design/frontend/rwd/default/template/page/html/topmenu/renderer.phtml
By default, View All
functionality has been added into RWD theme
of Magento. Since Magento team did not want to change layout of default theme, it introduced a completely new responsive theme known as RWD.
Please check code like below in renderer.phtml file and make changes in file of default theme accordingly:
if (!empty($_hasChildren)) {
$html .= '<ul class="level'. $childLevel .'">';
$html .= '<li class="level'. $nextChildLevel .' view-all">';
$html .= '<a class="level'. $nextChildLevel .'" href="'. $child->getUrl() .'">';
$html .= $this->__('View All') . ' ' . $this->escapeHtml($this->__($child->getName()));
$html .= '</a>';
$html .= '</li>';
$html .= $this->render($child, $childrenWrapClass);
$html .= '</ul>';
}
Please let me know if you find any problem.