News:

Looking for documentation? Take a look on our wiki

Main Menu

Browser Page Title for the Cart/Order

Started by Sassa83, September 19, 2013, 13:41:17 PM

Previous topic - Next topic

Sassa83

Hello everybody.

I use the actual Joomla and Virtuemart version. With Google I have found a code for the categories and product details page which pastes my web page name into the Page Title from my Browser. But for the shopping cart, payment choice and shipping choice i had not found any solution yet.

Can anybody tell me how i can put a SetTitle method into this pages, that my site name will shown into the page title?

Thanks.
Saskia

Maxim Pishnyak

Use Language Overrides.

BTW for cart you could create menu item and set title there.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Sassa83

I have test it before, but it don´t work.

- The language overrides changed the page title in the browser, but the main title of the page too. And that looks real strange when the website name stands in the main title too  ;D

- I have create the cart as menu item, but the page title then will override by the normal main title and i can´t find the code where this changes will make  :-[

Maxim Pishnyak

Check SetTitle in components\com_virtuemart\views\cart\view.html.php
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Sassa83

Thank you.

I don´t know, why i haven´t seen this before. I change the setTitles there and now it works fine.

surferchick

Quote from: Sassa83 on September 21, 2013, 17:30:37 PM
Thank you.

I don´t know, why i haven´t seen this before. I change the setTitles there and now it works fine.

Can I ask what you changed??
my code looks like this.... what do i need to do to make the Page Titles work!???

//Todo this may not work everytime as expected, because the error must be set in the redirect links.
      if(!empty($error)){
         $document->setTitle(JText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND').JText::sprintf('COM_VIRTUEMART_HOME',$vendor->vendor_store_name));
      } else {

         if(empty($vendor->customtitle)){
            $app = JFactory::getApplication();
            $menus = $app->getMenu();
            $menu = $menus->getActive();

            if ($menu){
               $menuTitle = $menu->params->get('page_title');
               if(empty($menuTitle)) {
                  $menuTitle = JText::sprintf('COM_VIRTUEMART_HOME',$vendor->vendor_store_name);
               }
               $document->setTitle($menuTitle);
            } else {
               $title = JText::sprintf('COM_VIRTUEMART_HOME',$vendor->vendor_store_name);
               $document->setTitle($title);
            }
         } else {
            $document->setTitle($vendor->customtitle);
         }