单击Opencart页面中的项目后,它将再次重定向到主页面而不是产品描述页面 . 我还在URL上添加了产品页面的手动路径作为index.php?route = product / product&product_id = 795但仍面临同样的问题 . 我还发现这个页面一次又一次地调用,直到它出现错误为“此页面无效” . 请帮我解决一下这个 .
你需要传递一个额外的变量 .
index.php?route=product/product&product_id=795&redirect=home
现在转到 catalog/controller/product/product.php 并将下面给出的代码粘贴到index方法中 . 这样的事情 .
catalog/controller/product/product.php
public function index() { if (isset($this->request->get['redirect'])) { $this->redirect($this->url->link('common/home', '', 'SSL')); }
或者如果你想用out url动态地改变它,那就转到
catalog/controller/product/category.php 并找到此代码 .
catalog/controller/product/category.php
'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
并替换为
'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url.'&redirect=home')
并且 catalog/controller/product/product.php 将如上所述 .
1 回答
你需要传递一个额外的变量 .
现在转到
catalog/controller/product/product.php
并将下面给出的代码粘贴到index方法中 . 这样的事情 .或者如果你想用out url动态地改变它,那就转到
catalog/controller/product/category.php
并找到此代码 .并替换为
并且
catalog/controller/product/product.php
将如上所述 .