Skip to main content

Trying to remove the Apply button

13 years 2 months ago - 13 years 2 months ago #120549 by xsbucks
I am trying to remove the 'APPLY' button on the new file upload . I wish to keep the save button.
Last edit: 13 years 2 months ago by Jerome.

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

13 years 2 months ago #120573 by Jerome
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.
Code:
<?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.

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

9 years 2 months ago #278746 by ChristopheMG
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.

9 years 2 months ago #278782 by Jerome
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.

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

9 years 2 months ago #278819 by ChristopheMG
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.

9 years 2 months ago #278820 by Jerome
The following user(s) said Thank You: ChristopheMG

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

9 years 2 months ago - 9 years 2 months ago #278878 by ChristopheMG
Thank you,
I had forgotten my other post to remove the text below the buttons, a useful reminder.
Fixed:
Code:
if(!empty($tool['icon'])&&($tool['icon']!=='apply')) { $content .= '<span class="btnIcon iconM-32-'.$tool['icon'].'"></span>'; }
Last edit: 9 years 2 months ago by ChristopheMG.

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

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