Custom vendor page, Remove back button and "Add User", change Save...

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

-- HikaShop version -- : 3.1.1
-- HikaMarket version -- : 1.7.3
-- Joomla version -- : 3.7.2
-- PHP version -- : 7.1.4
-- Browser(s) name and version -- : CHROME 59.0.3071.104

Hello,

On a "HikaMarket » Vendor edition" page showing my user (vendor) profile, I would like to remove the "back" button.
Also to change the "Save" button by a personalized button (create a new button with onclick="return window.hikamarket.submitform('save','hikamarket_vendor_form');")



It's probably in Display > views but I can't find the file.

Regards,

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

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

Hello,

The toolbar is displayed directly via the HikaMarket core.
The content is set in the "view.html.php" and then HikaMarket call the view "toolbar / default" for the display.

You can see to perform an override of that view and dynamically change the content depending the current "ctrl" and "task".
It is also possible to use a plugin and a trigger ; but in your case the view override would be easier.
www.hikashop.com/support/documentation/1...-display.html#layout

About the icons ; that is something you can directly change via CSS.
They already are displayed via the hikamarket "frontend_default" CSS file ; you can see to have your own rules in your template CSS or create an override for the HikaMarket file.
www.hikashop.com/support/documentation/1...the-display.html#css

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 9 months ago #272361

Thank you Jerome,

I found the file HikaMarket - toolbar / default.php

if(!empty($tool['icon'])) { $content .= '<span class="btnIcon iconM-32-'.$tool['icon'].'"></span>'; } /* here the buttons */
	if(!empty($tool['name'])) { $content .= '<span class="btnName">' . $tool['name'] . '</span>'; }   /* here the text */

I can make both buttons or texts ("back", "save") disappeared but I have hard time to just remove the back button and text "back"

Can you help please?

Last edit: 6 years 9 months ago by Jerome. Reason: removing the content of the full view ; please be sure that we already have that content

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

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

Hello,

In the toolbar default view, you have a loop on each button.

foreach($data as $key => $tool) {
And as you saw, the variable $tool is an array with different elements, like the icon, the name and the url.

The variable $key contains logically the namekey of the button, but unfortunately, in HikaMarket 1.7.3, some views do not have namekeys set properly.
So you have to edit the file "components/com_hikamarket/vendormarket/view.html.php" and replace
			$this->toolbar = array(
				array('icon' => 'back', 'name' => JText::_('HIKA_BACK'), 'url' => hikamarket::completeLink('vendor')),
				array(
					'url' => '#save',
					'linkattribs' => 'onclick="return window.hikamarket.submitform(\'save\',\'hikamarket_vendor_form\');"',
					'icon' => 'save',
					'name' => JText::_('HIKA_SAVE'), 'pos' => 'right'
				)
			);
By
			$this->toolbar = array(
				'back' => array('icon' => 'back', 'name' => JText::_('HIKA_BACK'), 'url' => hikamarket::completeLink('vendor')),
				'save' => array(
					'url' => '#save',
					'linkattribs' => 'onclick="return window.hikamarket.submitform(\'save\',\'hikamarket_vendor_form\');"',
					'icon' => 'save',
					'name' => JText::_('HIKA_SAVE'), 'pos' => 'right'
				)
			);
So you will be able to use the variable $key to know what is the button exactly.

And please do not forget to use $this->getLayout() and $this->getName() to only apply your modification on the vendormarket form.

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.

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