order the menu items

  • Posts: 21
  • Thank you received: 2
  • Hikaauction Standard Hikamarket Multivendor Hikashop Business
2 weeks 6 days ago #370022

-- HikaShop version -- : 6.2.0
-- Joomla version -- : 6
-- PHP version -- : 8.4
-- Browser(s) name and version -- : all

Hello, is there a way to order the menu item order for registered user inside hikamarket?

Also, since I deal with auctions only, I would like to hide 'carts', is there a way?



Thank you

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 85046
  • Thank you received: 13868
  • MODERATOR
2 weeks 6 days ago #370026

Hi,

Yes, you can reorder, hide, or modify the menu items in the customer control panel sidebar via a view override.

How to create the view override:
- Go to the HikaShop backend: Display > Views
- Find the view user / cpanel and click to edit it
- This creates an override where you can modify $this->buttons directly
- You can read more about view overrides here: www.hikashop.com/support/documentation/1...-display.html#layout

Example 1: Hide the "Carts" button:
At the beginning of your cpanel.php override, add:

<?php
// Hide the cart button
if(isset($this->buttons['cart'])) {
    unset($this->buttons['cart']);
}
?>
Example 2: Reorder buttons (put "Orders" first):
<?php
// Define your preferred order
$preferredOrder = array('order', 'address', 'cart', 'wishlist', 'download');
$orderedButtons = array();
// First, add buttons in preferred order
foreach($preferredOrder as $key) {
    if(isset($this->buttons[$key])) {
        $orderedButtons[$key] = $this->buttons[$key];
    }
}
// Then add any remaining buttons (from plugins like HikaMarket, HikaAuction)
foreach($this->buttons as $key => $btn) {
    if(!isset($orderedButtons[$key])) {
        $orderedButtons[$key] = $btn;
    }
}
$this->buttons = $orderedButtons;
?>
Example 3: For auctions only - hide carts and put auction-related buttons first
<?php
// 1. Remove buttons you don't want
$buttonsToHide = array('cart', 'wishlist');
foreach($buttonsToHide as $hide) {
    if(isset($this->buttons[$hide])) {
        unset($this->buttons[$hide]);
    }
}
// 2. Define your preferred order (auction buttons from HikaAuction first)
$preferredOrder = array('bids', 'order', 'address', 'download');
$orderedButtons = array();
foreach($preferredOrder as $key) {
    if(isset($this->buttons[$key])) {
        $orderedButtons[$key] = $this->buttons[$key];
    }
}
// Add any remaining plugin buttons
foreach($this->buttons as $key => $btn) {
    if(!isset($orderedButtons[$key])) {
        $orderedButtons[$key] = $btn;
    }
}
$this->buttons = $orderedButtons;
?>

The default HikaShop buttons use these keys:
address - Addresses
order - Orders
cart - Carts (Essential/Business only)
wishlist - Wishlists (Essential/Business only)
download - Downloads (Essential/Business only)
other extensions, like HikaMarket and HikaAuction, can add their own buttons using the onUserAccountDisplay event of HikaShop, and you can include their respective keys in your ordering.
you can add the code:
<?php var_dump($this->buttons); ?>
to see which buttons are added and what keys are used exactly.

The following user(s) said Thank You: lucad

Please Log in or Create an account to join the conversation.

  • Posts: 21
  • Thank you received: 2
  • Hikaauction Standard Hikamarket Multivendor Hikashop Business
2 weeks 4 days ago #370037

Thank you Nicolas, those worked

Also is there a way to hide some menu items for vendors please?

I want to hide :
Categories
Characteristics
Discounts
Shippings

Thank you
Luca

Attachments:
Last edit: 2 weeks 4 days ago by lucad.

Please Log in or Create an account to join the conversation.

  • Posts: 85046
  • Thank you received: 13868
  • MODERATOR
2 weeks 4 days ago #370039

Hi,

Well, with HikaMarket you get ACL settings in order to configure what vendors can and cannot do on the frontend:
www.hikashop.com/support/documentation/2...ontend-tutorial.html
If you remove their access to discounts, then the "Discounts" menu on their discounts control panel will be removed automatically.
Still, you can keep their access to them and hide the buttons from the control panel in the same way I explained in my previous message regarding the HikaShop user control panel. The only difference is that you need to edit the view file vendormarket / cpanel instead of user / cpanel and the keys are different :
category -> Categories
characteristic -> Characteristics
etc

The following user(s) said Thank You: lucad

Please Log in or Create an account to join the conversation.

  • Posts: 21
  • Thank you received: 2
  • Hikaauction Standard Hikamarket Multivendor Hikashop Business
2 weeks 3 days ago #370047

Hi Nicolas and thanks for your answer

in HikaMarket - vendormarket / cpanel.php
Added

<?php
// Hide the Characteristics button
if(isset($this->buttons)) {
unset($this->buttons);
}
?>
<?php
// Hide the categories button
if(isset($this->buttons)) {
unset($this->buttons);
}
?>

But this time it did not work

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 85046
  • Thank you received: 13868
  • MODERATOR
2 weeks 3 days ago #370048

Hi,

It's the other way around. "Characteristics" is the name you see on the interface. "characteristic" is the key used in the array. And it's the key you want to use in your code, not the name you see on the interface.

The following user(s) said Thank You: lucad

Please Log in or Create an account to join the conversation.

  • Posts: 21
  • Thank you received: 2
  • Hikaauction Standard Hikamarket Multivendor Hikashop Business
2 weeks 3 days ago #370054

You can easily see I am not a coder :)

Thanks, that worked

Thank you

Please Log in or Create an account to join the conversation.

Time to create page: 0.081 seconds
Powered by Kunena Forum