VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Sassa83 on September 19, 2013, 13:41:17 PM

Title: Browser Page Title for the Cart/Order
Post by: Sassa83 on September 19, 2013, 13:41:17 PM
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
Title: Re: Browser Page Title for the Cart/Order
Post by: Maxim Pishnyak on September 20, 2013, 12:54:13 PM
Use Language Overrides.

BTW for cart you could create menu item and set title there.
Title: Re: Browser Page Title for the Cart/Order
Post by: Sassa83 on September 21, 2013, 11:03:13 AM
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  :-[
Title: Re: Browser Page Title for the Cart/Order
Post by: Maxim Pishnyak on September 21, 2013, 13:11:31 PM
Check SetTitle in components\com_virtuemart\views\cart\view.html.php
Title: Re: Browser Page Title for the Cart/Order
Post by: 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.
Title: Re: Browser Page Title for the Cart/Order
Post by: surferchick on November 07, 2013, 13:03:01 PM
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);
         }