【问题标题】:Pagination not working in opencart when SEO enabled启用 SEO 时,分页在 opencart 中不起作用
【发布时间】:2013-11-19 10:45:47
【问题描述】:

您好,我在我的一个网站上使用 Opencart,但我意识到当我打开 SEO 关键字时,分页不起作用。当 SEO 关闭时,它工作正常。

有没有人知道为什么会这样。

我试图在 opencart 论坛上找到答案,但没有运气,而且我在堆栈溢出时也找不到任何东西......

这是我的 htaccess 文件的代码。

Options +FollowSymlinks
# Prevent Directoy listing Options -Indexes
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
     Order deny,allow
 Deny from all
</FilesMatch>
# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ 
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

这是其中一个页面的链接

http://pubstuff.co.za/Bar/Ashtrays

在category.php页面可以看到分页代码

$pagination = new Pagination();
        $pagination->total = $product_total;
        $pagination->page = $page;
        $pagination->limit = $limit;
        $pagination->text = $this->language->get('text_pagination');
        $pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}');

它仍在尝试调用“链接”或 url 作为正确项目的路径,但我不知道如何更改它以调用新呈现的 SEO 友好 URL 的 URL

有人可以帮忙吗。

【问题讨论】:

  • 通过新呈现的 SEO 友好 URL 你的意思是你已经安装了一些 SEO 扩展?因为只使用 seo_keyword 字段和默认的 OpenCart 的 SEO 功能,这工作正常......
  • 只是opencert的标准seo关键字功能...

标签: php pagination seo opencart


【解决方案1】:

在您提供的链接中没有足够的产品导致分页。在产品数量至少超过 25 个限制之前,您不会获得分页。

http://pubstuff.co.za/Gifts-and-novelties/Other-gifts 是这种情况 - 87 件商品,但是,当我选择 25 件商品限制时,页面会自动重新加载 100 件商品限制,因此我无法确认这是错误的。由于上面的 shadyyx cmets 对于默认的 SEO 来说很好,所以可能是您的主题中的某些东西导致了错误。

【讨论】:

  • 嗨,对不起,我更改了限制,同时显示最多 100 个项目
  • 我能理解。您是否有一个登台服务器,您可以在其中显示其所描述的功能?您不需要修改代码 - opencart 将常规路径解析为 SEO 路径。你有没有重命名htaccess?你的服务器允许吗?您可以访问您的 php 设置还是共享主机?在 httpd.conf 中检查 OverideAllowed 是否设置为 All(默认为 none)
  • 所以 SEO URL 工作但没有分页?抱歉,上面的一些建议是解决 SEO URL 不起作用的问题。您可能需要转至聊天来解决此问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-02-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多