Trying to remove the Apply button

  • Posts: 61
  • Thank you received: 2
10 years 7 months ago #120549

I am trying to remove the 'APPLY' button on the new file upload . I wish to keep the save button.

Last edit: 10 years 7 months ago by Jerome.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 7 months ago #120573

Hi,

First you have to re-download HikaMarket 1.3.0, I update the package in order to allow a plugin to access to the toolbar (and activate a trigger).
After that, you will be able to use that little custom plugin.

<?php
class plgHikamarketCustomtoolbar01 extends JPlugin {
	public function onHikamarketBeforeDisplayView(&$view) {
		$app = JFactory::getApplication();
		$ctrl = JRequest::getCmd('ctrl', '');
		$layout = $view->getLayout();
		if(!$app->isAdmin() && $ctrl == 'product' && $layout = 'form' && isset($view->toolbar['apply'])) {
			unset($view->toolbar['apply']);
		}
	}
}
It uses a special view trigger in order to access to the toolbar of the page and modify it.
In our case, it removes the button "apply". But you can also change a button or add new ones.

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.
Attachments:

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

  • Posts: 99
  • Thank you received: 0
6 years 7 months ago #278746

Hi,

I'm trying to remove the Apply button too, Save is enough, I created the plugin with 3 files: xml, php with the code above and index.html.
I installed and activated it but I still see the button Apply.

I was wondering if I can use the override technique ? But I can't find the file in Views with the apply buton, it's not in HikaMarket - toolbar / default.php for sure...
www.hikashop.com/forum/19-hikamarket/890...ser-change-save.html

Regards,

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 6 months ago #278782

Hello,

The trick I gave 4 years ago was to remove the button for a specific view.
In 4 years, HikaMarket has evolve and now you can find a view to display the toolbar ; which allow you to perform a view override instead of a custom plugin.
That view process the "toolbar" variable to display the buttons ; in that view you can see to "skip" the buttons that you don't want to display.

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.

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

  • Posts: 99
  • Thank you received: 0
6 years 6 months ago #278819

Thank you Jerome,
Here is the line for all the buttons:
if(!empty($tool)) { $content .= '<span class="btnIcon iconM-32-'.$tool.'"></span>'; }
Then icon becomes "back", "apply" and "save"
How could I remove just apply please ?

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 6 months ago #278820

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: ChristopheMG

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

  • Posts: 99
  • Thank you received: 0
6 years 6 months ago #278878

Thank you,
I had forgotten my other post to remove the text below the buttons, a useful reminder.
Fixed:

if(!empty($tool['icon'])&&($tool['icon']!=='apply')) { $content .= '<span class="btnIcon iconM-32-'.$tool['icon'].'"></span>'; }

Last edit: 6 years 6 months ago by ChristopheMG.

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

Moderators: Obsidev
Time to create page: 0.075 seconds
Powered by Kunena Forum