File: /home4/cca63905/public_html/nueva/modules/pmproductvideoreviews/controllers/front/seeProduct.php
<?php
/**
* rec.reviews
*
* @author Presta-Module.com <support@presta-module.com> - https://www.presta-module.com
* @copyright Presta-Module - https://www.presta-module.com
* @license see file: LICENSE.txt
*
* ____ __ __
* | _ \ | \/ |
* | |_) | | |\/| |
* | __/ | | | |
* |_| |_| |_|
*/
if (!defined('_PS_VERSION_')) {
exit;
}
class pmproductvideoreviewsSeeProductModuleFrontController extends ModuleFrontController
{
/**
* method manage post data
*
* @throws Exception
*/
public function postProcess()
{
$token = json_decode(Configuration::get('PVR_OAUTH'));
$client_id = Tools::getValue('client_id');
if (!empty($token) && $token->clientId == $client_id) {
$product_id = Tools::getValue('id_product');
$product = new Product((int)$product_id);
$default_category = new Category((int)$product->getDefaultCategory(), (int)$this->context->language->id);
$link = Context::getContext()->link->getProductLink($product, null, Tools::strtolower($default_category->link_rewrite), null, (int)$this->context->language->id, null, 0, true);
Tools::redirect($link);
}
die;
}
}