20 lines
505 B
PHP
20 lines
505 B
PHP
<?php
|
|
|
|
class ProductController extends ProductControllerCore
|
|
{
|
|
public function canonicalRedirection($canonical_url = '')
|
|
{
|
|
if (is_object($this->product) && Configuration::get('X13LINKREWRITE_PRODUCT_R')) {
|
|
if (!$this->product->active) {
|
|
$category = new Category($this->product->id_category_default);
|
|
if ($category->active) {
|
|
Tools::redirect($this->context->link->getCategoryLink($category->id));
|
|
die();
|
|
}
|
|
}
|
|
}
|
|
|
|
parent::canonicalRedirection($canonical_url);
|
|
}
|
|
}
|