News:

Looking for documentation? Take a look on our wiki

Main Menu

Child category navigation buttons

Started by glassdog, February 19, 2018, 01:40:56 AM

Previous topic - Next topic

glassdog

I am setting up VirtueMart 3.2.12 in catalog mode on Joomla 3.8.5, warp theme Mambo running on PHP 5.6.3 on Apache server. My menu link is set to category with a main category and child categories.  Products are all contained in the child categories; when i click into each child category there is no back button to the parent category, how do i add this?  When I go into each product there is a button back to whatever child category it is in so that is fine.  I have searched the forums found several similair questions but no solutions. 

Example
Shopping (parent)
  L child 1
  l   L Products
  l
  L Child 2
      L Products

Studio 42

Why not activate Joomla breadcrumb module ?

glassdog

#2
Breadcrumbs are active but i have no idea how i would edit it into the template for a link back to root to be displayed for just that section.
  Additionally a simple button for customers would be easier to understand and use

Studio 42

YOu have to edit the virtuemart category view, to add a backlink button and get parent or root category.
Do you have some knowledge of php ?

glassdog

I can follow directions for basic edits of PHP files I have made some changes to them in the past. Is there an eample i can use to make the edit ?

Studio 42

The simplest code is
<a href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category'); ?>">Return to Main category</a>
If link is bad try to change the echo
JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=0');
or
JRoute::_('index.php?option=com_virtuemart&view=virtuemart);
In file YOURSITE/components/com_virtuemart/views/category/tmpl/default.php or do an override in your template

glassdog

Studio 42
thank you for the solution it works but I cant seem to figure out how to move it up from the bottom of the page up by the search box area. 

Studio 42

If you insert it on top of the file, you should see on top, Else you have perhaps a CSS rule to change or add a <div></div>.