We noticed that OpenCart accepts product_id numbers and text, thereby opening a double of the old page.
For example: product_id = 43AZAZAZAZAZA
https://demo.opencart.com/index.php?rou ... ZAZAZAZAZA
Code: Select all
<link href="https://demo.opencart.com/index.php?route=product/product&product_id=43AZAZAZAZAZA" rel="canonical" />
<input type="hidden" name="redirect" value="https://demo.opencart.com/index.php?route=product/product&[b]product_id=43AZAZAZAZAZA" />
<li><a href="https://demo.opencart.com/index.php?route=product/product&product_id=43AZAZAZAZAZA">MacBook</a></li>
We fixed this bug like this:
Code: Select all
/catalog/controller/product/product.php
if (isset($this->request->get['product_id'])) {
// проверка на такие товары index.php?route=product/product&path=71_77&product_id=53asdasdasd
if(filter_var($this->request->get['product_id'],FILTER_VALIDATE_INT)){
$product_id = (int)$this->request->get['product_id'];
}
else
{
$product_id = 0;
}
} else {
$product_id = 0;
}
Thank!