[-] FO : Fix bug #PSCFV-9021 : bad category id for breadcrumb on product when url rewrite is on
This commit is contained in:
1 parent
4f5661572e
commit
5e0893979b
1 file changed
+2
-1
@@ -143,7 +143,8 @@ class ProductControllerCore extends FrontController
|
|||||||
// Load category
|
// Load category
|
||||||
if (isset($_SERVER['HTTP_REFERER'])
|
if (isset($_SERVER['HTTP_REFERER'])
|
||||||
&& strstr($_SERVER['HTTP_REFERER'], Tools::getHttpHost()) // Assure us the previous page was one of the shop
|
&& strstr($_SERVER['HTTP_REFERER'], Tools::getHttpHost()) // Assure us the previous page was one of the shop
|
||||||
&& preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs))
|
&& (stripos($_SERVER['HTTP_REFERER'], '.html') === false)
|
||||||
|
&& preg_match('~^(.*)\/([0-9]+)\-((?![.]+html).*)|(.*)id_category=([0-9]+)(.*)$~', $_SERVER['HTTP_REFERER'], $regs))
|
||||||
{
|
{
|
||||||
// If the previous page was a category and is a parent category of the product use this category as parent category
|
// If the previous page was a category and is a parent category of the product use this category as parent category
|
||||||
if (isset($regs[2]) && is_numeric($regs[2]))
|
if (isset($regs[2]) && is_numeric($regs[2]))
|
||||||
|
|||||||
Reference in new issue
Block a user