VirtueMart Forum

VirtueMart 2 + 3 => Frontend Modules => Topic started by: glassdog on February 19, 2018, 01:40:56 am

Title: Child category navigation buttons
Post by: glassdog on February 19, 2018, 01:40:56 am
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
 
Title: Re: Child category navigation buttons
Post by: Studio 42 on February 19, 2018, 02:18:45 am
Why not activate Joomla breadcrumb module ?
Title: Re: Child category navigation buttons
Post by: glassdog on February 19, 2018, 03:54:29 am
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
Title: Re: Child category navigation buttons
Post by: Studio 42 on February 19, 2018, 11:42:07 am
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 ?
Title: Re: Child category navigation buttons
Post by: glassdog on February 19, 2018, 14:37:39 pm
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 ?
Title: Re: Child category navigation buttons
Post by: Studio 42 on February 19, 2018, 15:24:50 pm
The simplest code is
Code: [Select]
<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
Title: Re: Child category navigation buttons
Post by: glassdog on February 20, 2018, 05:27:18 am
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. 
Title: Re: Child category navigation buttons
Post by: Studio 42 on February 20, 2018, 11:24:34 am
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>.