Author Topic: Child category navigation buttons  (Read 1168 times)

glassdog

  • Beginner
  • *
  • Posts: 8
  • A beginner
Child category navigation buttons
« 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
 

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3458
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Child category navigation buttons
« Reply #1 on: February 19, 2018, 02:18:45 am »
Why not activate Joomla breadcrumb module ?

glassdog

  • Beginner
  • *
  • Posts: 8
  • A beginner
Re: Child category navigation buttons
« Reply #2 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

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3458
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Child category navigation buttons
« Reply #3 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 ?

glassdog

  • Beginner
  • *
  • Posts: 8
  • A beginner
Re: Child category navigation buttons
« Reply #4 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 ?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3458
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Child category navigation buttons
« Reply #5 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

glassdog

  • Beginner
  • *
  • Posts: 8
  • A beginner
Re: Child category navigation buttons
« Reply #6 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. 

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3458
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: Child category navigation buttons
« Reply #7 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>.