Skip to content

Instantly share code, notes, and snippets.

@Baulcode
Created October 16, 2022 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Baulcode/cd79401386975626f6a80f8d487269ce to your computer and use it in GitHub Desktop.
Save Baulcode/cd79401386975626f6a80f8d487269ce to your computer and use it in GitHub Desktop.
<?php
global $cookie;
include '../../config/settings.inc.php';
include '../../config/defines.inc.php';
include '../../config/config.inc.php';
include 'init.php';
// Id de producto
$id_product = 13;
$sql = Db::getInstance()->ExecuteS('SELECT p.id_product,
cl.link_rewrite as crewrite, pl.link_rewrite as prewrite, p.id_product
FROM '._DB_PREFIX_.'product p
INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON
p.`id_product` = pl.`id_product`
INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON
p.`id_category_default` = cl.`id_category`
WHERE p.`id_product` = '.$id_producto.'');
foreach($sql as $row){
if($row['crewrite']!=""){
echo "/".$row['crewrite']."/".$row['id_product']."-".$row['prewrite'].".html";
}else{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment