Page title on checkout

  • Posts: 26
  • Thank you received: 0
11 years 1 month ago #152983

Using the latest version 2.3.0 starter.

When I go to checkout process my page title (in browser) changes in a way that it loses my website's name I set in Global configuration of joomla. It's fine when just browsing the category/product listing and on product pages.

How can I add website name to the checkout process?

thanks

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

  • Posts: 83990
  • Thank you received: 13604
  • MODERATOR
11 years 1 month ago #152994

Hi,

You'll have to add the code:

$document = JFactory::getDocument();
		$checkout_name = JText::_('CHECKOUT');
		if (empty($checkout_name)) {
			$checkout_name = $app->getCfg('sitename');
		}
		elseif ($app->getCfg('sitename_pagetitles', 0) == 1) {
			$checkout_name = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $checkout_name);
		}
		elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
			$checkout_name = JText::sprintf('JPAGETITLE', $checkout_name, $app->getCfg('sitename'));
		}
		$document->setTitle( strip_tags($checkout_name) );
after the line:
$this->assignRef('display_checkout_bar',$this->display_checkout_bar);
in the file components/com_hikashop/views/checkout/view.html.php

The following user(s) said Thank You: jdoe

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

  • Posts: 26
  • Thank you received: 0
11 years 1 month ago #153126

Thank you, it worked.
What will happen after future hikashop updates with files changed like that?

Also, I would like for pages User control panel, orders and addresses to have site name in browsers as well. Can you give me a hint?

Any reason why this doesn't act as set-up in global configuration of joomla?

Last edit: 11 years 1 month ago by jdoe.

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

  • Posts: 83990
  • Thank you received: 13604
  • MODERATOR
11 years 1 month ago #153149

You will loose such change done directly to the files when you update. The preferred method is to edit a view file via the menu Display->Views to add such code addition.
However, this modification will be included in next version of HikaShop, so you won't need to add it again after you update.

For the other pages, similar modifications will be done for next release of HikaShop so if you update HikaShopin a month, you'll get the titles everywhere. If you want to add that in the mean time, you would have to basically edit all the view.html.php files of the components/com_hikashop/views subfolders and add it to the listing/show functions there if no$document->setTitle call already present and simply change the line:
$checkout_name = JText::_('CHECKOUT');
to:
$checkout_name = 'My title';

where My title is the page title you want for the page.

It didn't act as set-up in the global configuration of Joomla because it has to be handled by each extension and that this parameter wasn't taken into account so far for these pages.

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

  • Posts: 26
  • Thank you received: 0
11 years 1 month ago #153236

Sorry, but I cant find the line $checkout_name = JText::_('CHECKOUT') anywhere in those 'view.html.php' files. Folders I looked in: 'address', 'order' and 'user'.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #153259

Hi,

I think that Nicolas was talking about the code he gave you previously.
www.hikashop.com/forum/checkout/867590-p...checkout.html#152994

After having added that code, you can replace the line by what you want.

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

  • Posts: 6
  • Thank you received: 0
11 years 1 month ago #154466

You could use a plugin for SEO such as this: EFSEO - Easy Frontend SEO

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

Time to create page: 0.074 seconds
Powered by Kunena Forum