Remove button from the user control panel

  • Posts: 3
  • Thank you received: 0
8 years 8 months ago #210307

-- HikaShop version -- : 2.5.0

Hello, i have 2 questions.
1- I would like to remove the " manage your addresses " from the user control panel. I've tried some codes posted here in the forum but did not work .



2- How do I insert buttons ( just like this ) on the control panel ? Is there any tutorial or something?

Thanks

Attachments:

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
8 years 8 months ago #210308

Hi,

1 - In the view "frontend / your front-end template / user / cpanel", you have to place just before

foreach($this->buttons as $oneButton) {
Some code to remove the buttons you do not want, like
unset($this->buttons['address']);
foreach($this->buttons as $oneButton) {

2 - With the same kind of process, you need to add a new entry in the PHP array variable
$this->buttons['address'] = array(
	'link' => hikashop_completeLink('address'),
	'level' => 0,
	'image' => 'address',
	'text' => JText::_('ADDRESSES'),
	'description' => '<ul><li>'.JText::_('MANAGE_ADDRESSES').'</li></ul>'
);
foreach($this->buttons as $oneButton) {

More about customization and view overrides :
www.hikashop.com/support/support/documen...ize-the-display.html

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: Ferhanzo, Osindelka

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

  • Posts: 6
  • Thank you received: 0
8 years 8 months ago #210835

Hello
Similar problem in user / cpanel.php ...this works to remove address

unset($this->buttons['address']);
but similar code does not move affiliate program button
    unset($this->buttons['affiliate']);
Is their a problem with the naming ? I tried affiliates, partner, partners etc ...
thanks

Last edit: 8 years 8 months ago by Jerome. Reason: [code] is nice

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

  • Posts: 81515
  • Thank you received: 13068
  • MODERATOR
8 years 8 months ago #210840

Hi,

There is no problem with the naming. The naming is just a number for the affiliate button.
Do a var_dump() of the $this->buttons variable and you'll see the key of each element in the array so that you can use it for the affiliate.
But if you don't need the affiliate button, then maybe it means that you don't need the affiliate feature at all, and in that case, it's even better to just disable the HikaShop affiliate plugin via the Joomla plugins manager.

The following user(s) said Thank You: Cossettini

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

  • Posts: 6
  • Thank you received: 0
8 years 8 months ago #210919

Yes. I disabled the affiliate plugin and it works. Thanks

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

  • Posts: 61
  • Thank you received: 0
8 years 6 months ago #217469

Jerome wrote: 2 - With the same kind of process, you need to add a new entry in the PHP array variable

$this->buttons['address'] = array(
	'link' => hikashop_completeLink('address'),
	'level' => 0,
	'image' => 'address',
	'text' => JText::_('ADDRESSES'),
	'description' => '<ul><li>'.JText::_('MANAGE_ADDRESSES').'</li></ul>'
);
foreach($this->buttons as $oneButton) {

Guys, can I ask you to give me a sample code please? Unfortunately I don't know php, and it's quite difficult for me to make it correct. For examle I have a link for new button - site.com/link.html and image for button site.com/image.jpg .

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

  • Posts: 13201
  • Thank you received: 2322
8 years 6 months ago #217484

Hi,

You can use that code:

$this->buttons['mybutton'] = array(
	'link' => JUri::base().'/link',
	'level' => 0,
	'image' => 'image',
	'text' => JText::_('MY_TEXT'),
	'description' => '<ul><li>'.JText::_('MY_DESCRIPTION').'</li></ul>'
);

For the image, you will have to add an image in the folder "media/com_hikashop/images/icons" and name it like: "icon-48-image.png"

Last edit: 8 years 6 months ago by Xavier.
The following user(s) said Thank You: DimLVL

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

  • Posts: 223
  • Thank you received: 26
  • Hikashop Business
2 years 7 months ago #335402

For this topic, the solution it is still the same, editing the view or to use css to hide them?

Last edit: 2 years 7 months ago by oxido.

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

  • Posts: 81515
  • Thank you received: 13068
  • MODERATOR
2 years 7 months ago #335406

Hi,

You don't need to edit the view anymore.
You can just add such CSS:

.hikashop_cpanel_address_div { display: none; }

The following user(s) said Thank You: oxido

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

  • Posts: 223
  • Thank you received: 26
  • Hikashop Business
2 years 7 months ago #335431

tip: need to use !important
.hikashop_cpanel_address_div { display: none !important; }

The following user(s) said Thank You: nicolas

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

Time to create page: 0.120 seconds
Powered by Kunena Forum