Jump to content

首页标题设置了meta title后怎么去掉前面的商店名称?谢谢!


Recommended Posts

我的网站首页标题设置了meta title后,标题成了"商店名称- meta title ", 该怎么去掉前面的商店名称?谢谢!

英文不怎么好,一下找不到答案,希望知道的同学告诉我一下 ,谢谢~~

Share this post


Link to post
Share on other sites
  • 9 months later...

1. 备份后打开classes/Tools.php
2. 查找第525行:

$metaTags['meta_title'] = $defaultValue.' - '.Configuration::get('PS_SHOP_NAME');


3. 修改为:

$metaTags['meta_title'] = $defaultValue;


4. 保存,测试。

Share this post


Link to post
Share on other sites
  • 3 weeks later...
1. 备份后打开classes/Tools.php
2. 查找第525行:
$metaTags['meta_title'] = $defaultValue.' - '.Configuration::get('PS_SHOP_NAME');


3. 修改为:

$metaTags['meta_title'] = $defaultValue;


4. 保存,测试。



我的是PS最新版,上面的代码在弟505行,按照上面的方法修改以后,问题解决了,但是后台的订单管理中,发票的PDF文档不能导出,提示以下错误:

FPDF error: Some data has already been output, can't send PDF file

请问是什么问题?如何解决?

Share this post


Link to post
Share on other sites

你在做上面的修改前,能成功导出PDF Invoices吗?

1. 备份后打开admin/AdminInvoices.php
2. 第80行

Tools::redirectAdmin('pdf.php?invoices&date;_from='.strval($_POST['date_from']).'&date;_to='.strval($_POST['date_to']).'&token;='.$this->token);


3. 修改为:

Tools::redirectAdmin('pdf.php?invoices&date;_from='.urlencode($_POST['date_from']).'&date;_to='.urlencode($_POST['date_to']).'&token;='.$this->token);


4. 保存,测试。

Share this post


Link to post
Share on other sites
你在做上面的修改前,能成功导出PDF Invoices吗?

1. 备份后打开admin/AdminInvoices.php
2. 第80行
Tools::redirectAdmin('pdf.php?invoices&date;_from='.strval($_POST['date_from']).'&date;_to='.strval($_POST['date_to']).'&token;='.$this->token);


3. 修改为:

Tools::redirectAdmin('pdf.php?invoices&date;_from='.urlencode($_POST['date_from']).'&date;_to='.urlencode($_POST['date_to']).'&token;='.$this->token);


4. 保存,测试。



做修改之前,可以成功导出PDF Invioces

打开这个文件后,第80行的内容和你发出来的是不一样的,我的是1.2.5版,截图如下,麻烦看一下,谢谢!

16938_hxqxX5dCQV8jJFY9njyc_t

Share this post


Link to post
Share on other sites
  • 1 year later...
  • 3 years later...

1.6 以上版本,在

/classes/Meta.php

 

public static function getHomeMetas($id_lang, $page_name)
{
$metas = Meta::getMetaByPage($page_name, $id_lang);
$ret['meta_title'] = (isset($metas['title']) && $metas['title']) ? Configuration::get('PS_SHOP_NAME').' - '.$metas['title'] : Configuration::get('PS_SHOP_NAME');
$ret['meta_description'] = (isset($metas['description']) && $metas['description']) ? $metas['description'] : '';
$ret['meta_keywords'] = (isset($metas['keywords']) && $metas['keywords']) ? $metas['keywords'] :  '';
return $ret;
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More