Jump to content

Store > Browse All, Stop Defaulting


Jez

Recommended Posts

Hi There,

 

Wondering if someone could help me or indicate where I might look to stop the defaulting to the first product group when a user clicks on Browse All under Store.

 

I'm hoping for it to list the product groups rather than take you straight to the first one.

 

Thanks,

 

Jez

Link to comment
Share on other sites

Hi Jez,

 

Wondering if someone could help me or indicate where I might look to stop the defaulting to the first product group when a user clicks on Browse All under Store.

I'm hoping for it to list the product groups rather than take you straight to the first one.

I can think of three options, depending on exactly what you want to do...

 

1. if you just wanted to remove the Browse All child item and use the dropdown as a list of product groups, you could use an action hook...

 

<?php

/**
* Browse All Remove Navbar Link
* @author brian!
*/

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
   if (!is_null($primaryNavbar->getChild('Store'))) {
                   $primaryNavbar->getChild('Store')
                               ->removeChild('Browse Products Services')
                               ->removeChild('Shop Divider 1');
   }
});

2. if you wanted to change the link to a custom page showing product groups...

 

<?php

/**
* Browse All Change Navbar Link
* @author brian!
*/

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
   if (!is_null($primaryNavbar->getChild('Store'))) {
                   $primaryNavbar->getChild('Store')
                               ->getChild('Browse Products Services')
                               ->setURI('custom.php');
   }
});

 

3. the third option would be to modify the products.tpl page of your orderform template - by default, the old 'Slider' orderform template used to do this, but it's no longer included with WHMCS... exactly how will depend on the orderform template that you're using - an example of which is shown below...

 

https://forum.whmcs.com/showthread.php?116082-separate-Page-for-Product-Categories

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated