{$_SERVER['REQUEST_URI']} -->"; if($codice !=''){ require_once($_SERVER["DOCUMENT_ROOT"].'/ecomm/libs/ecLib.php'); require_once($_SERVER["DOCUMENT_ROOT"].'/ecomm/libs/cartLib.php'); $debug = (int) @$_REQUEST['debug']; //if($debug == 0) $debug = fromTelemar(); /*$sql = "select ID,NAME,NAME_ENG,cast(ShortDescription as text) as SHORTDESCRIPTION, cast(FullDescription as text) as FULLDESCRIPTION,cast(ShortDescription_eng as text) as SHORTDESCRIPTION_ENG,cast(FullDescription_eng as text) as FULLDESCRIPTION_ENG,URL_ITA,VIDEO_URL_1,VIDEO_URL_2,VIDEO_URL_3,MANUFACTURER, (select DESCRIZIONE from SEZIONI where id= Product.MANUFACTURER) as BRAND, (select top 1 descrizione from Sezioni S LEFT JOIN Product_Section_Association PSA ON PSA.Idsezione=S.ID and PSA.Main=1 where PSA.ProductId = Product.ID) as CATEGORY, (select top 1 S.ID from Sezioni S LEFT JOIN Product_Section_Association PSA ON PSA.Idsezione=S.ID and PSA.Main=1 where PSA.ProductId = Product.ID) as SECTIONID, (select TOP 1 s1.descrizione from Sezioni s1 left join Sezioni s2 on s1.id=s2.padre left join Product_Section_Association sa on s2.id=sa.Idsezione where sa.Main=1 and sa.ProductId=Product.ID) as CATEGORY2, SKU from PRODUCT where Product.ID ='".str_replace("'","''",$codice)."'";*/ if ($lang == 'en') { $sql =" select ID,NAME,NAME_ENG,cast(ShortDescription as text) as SHORTDESCRIPTION, cast(FullDescription as text) as FULLDESCRIPTION,cast(ShortDescription_eng as text) as SHORTDESCRIPTION_ENG,cast(FullDescription_eng as text) as FULLDESCRIPTION_ENG,URL_ITA,URL_ENG,VIDEO_URL_1,VIDEO_URL_2,VIDEO_URL_3,MANUFACTURER, (select DESCRIZIONE from SEZIONI where id= Product.MANUFACTURER) as BRAND, (select top 1 titolo from (((TestiArticoli INNER JOIN RelArticoliSezioni ON TestiArticoli.idArticolo = RelArticoliSezioni.idArticolo) INNER JOIN Sezioni S ON RelArticoliSezioni.idSezione = S.id) INNER JOIN Product_Section_Association PSA ON PSA.Idsezione=S.id and PSA.Main=1) where PSA.ProductId = Product.ID and TestiArticoli.idLingua = 'ENG') as CATEGORY, (select top 1 S.ID from Sezioni S INNER JOIN Product_Section_Association PSA ON PSA.Idsezione=S.ID and PSA.Main=1 where PSA.ProductId = Product.ID) as SECTIONID, (select TOP 1 titolo from ((((TestiArticoli inner join RelArticoliSezioni on TestiArticoli.idArticolo = RelArticoliSezioni.idArticolo) INNER JOIN Sezioni s1 on RelArticoliSezioni.idSezione = s1.id) inner join Sezioni s2 on s1.id=s2.padre) inner join Product_Section_Association sa on s2.id=sa.Idsezione) where sa.Main=1 and sa.ProductId=Product.ID and TestiArticoli.idLingua = 'ENG') as CATEGORY2, SKU from PRODUCT where Product.ID ='".str_replace("'","''",$codice)."'"; } else { $sql =" select ID,NAME,NAME_ENG,cast(ShortDescription as text) as SHORTDESCRIPTION, cast(FullDescription as text) as FULLDESCRIPTION,cast(ShortDescription_eng as text) as SHORTDESCRIPTION_ENG,cast(FullDescription_eng as text) as FULLDESCRIPTION_ENG,URL_ITA,URL_ENG,VIDEO_URL_1,VIDEO_URL_2,VIDEO_URL_3,MANUFACTURER, (select DESCRIZIONE from SEZIONI where id= Product.MANUFACTURER) as BRAND, (select top 1 titolo from (((TestiArticoli INNER JOIN RelArticoliSezioni ON TestiArticoli.idArticolo = RelArticoliSezioni.idArticolo) INNER JOIN Sezioni S ON RelArticoliSezioni.idSezione = S.id) INNER JOIN Product_Section_Association PSA ON PSA.Idsezione=S.id and PSA.Main=1) where PSA.ProductId = Product.ID and TestiArticoli.idLingua = 'ITA') as CATEGORY, (select top 1 S.ID from Sezioni S INNER JOIN Product_Section_Association PSA ON PSA.Idsezione=S.ID and PSA.Main=1 where PSA.ProductId = Product.ID) as SECTIONID, (select TOP 1 titolo from ((((TestiArticoli inner join RelArticoliSezioni on TestiArticoli.idArticolo = RelArticoliSezioni.idArticolo) INNER JOIN Sezioni s1 on RelArticoliSezioni.idSezione = s1.id) inner join Sezioni s2 on s1.id=s2.padre) inner join Product_Section_Association sa on s2.id=sa.Idsezione) where sa.Main=1 and sa.ProductId=Product.ID and TestiArticoli.idLingua = 'ITA') as CATEGORY2, SKU from PRODUCT where Product.ID ='".str_replace("'","''",$codice)."'"; } if($debug) echo "
1: sql base= ".$sql; $res = mssql_query($sql,$Conn) or die('
Line '.__LINE__.' Query non eseguita: '.mssql_get_last_message()); if($record = mssql_fetch_array($res,1)){ @mssql_free_result($res); /* Foto */ $record['foto'] = array(); $sql = "SELECT ID, NAME,DESCRIPTION_ITA,DESCRIPTION_ENG,MIMETYPE,ISFRONT,PRODUCTID FROM PICTURE WHERE PRODUCTID=".str_replace("'","''",$codice)." order by CASE WHEN ordinale Is NULL Then 1 Else 0 End, ordinale"; if($debug) echo "
2: sql foto= ".$sql; $res = mssql_query($sql,$Conn) or die('
Line '.__LINE__.' Query non eseguita: '.mssql_get_last_message()); while($row = mssql_fetch_array($res,1)){ $record['foto'][] = $row; } @mssql_free_result($res); $_MARCA = @$record['BRAND']; /* Varianti */ $record['variants'] = array(); $sql = "select ID,NAME,CAST(DESCRIPTION AS TEXT) AS DESCRIPTION,SKU,PRICE,OLDPRICE, ORDERMINIMUMQUANTITY, ORDERMAXIMUMQUANTITY,ISGIVI,DISCOUNT,SIZE,DELIVERY_DAYS, STOCKQUANTITY from ProductVariant where ISPRESENT=1 AND ProductID='".str_replace("'","''",$codice)."' order by isGivi DESC, StockQuantity DESC, delivery_days DESC, PRICE DESC, (CASE WHEN size='S' THEN 0 WHEN size='M' THEN 1 WHEN size='L' THEN 2 WHEN size='XL' THEN 3 when size='XXL' THEN 4 when size='3XL' THEN 5 ELSE 6 END)"; if($debug) echo "
3: sql varianti= ".$sql; $res = mssql_query($sql,$Conn) or die('
Line '.__LINE__.' Query non eseguita: '.mssql_get_last_message()); while ($row = mssql_fetch_assoc ($res)) { $prezzi = cartLib_getPrezziItem($row); $row['prezzoFinale']=$prezzi['prezzoFinale']; $row['promoPrezzo']=$prezzi['promoPrezzo']; $row['promoSconto']=$prezzi['promoSconto']; list($minQ,$maxQ) = cartLib_getQLimits($row); $row['minQ']=$minQ; $row['maxQ']=$maxQ; $row['BRAND'] = @$_MARCA; // if(@$row['DELIVERY_DAYS'] == '' || @$row['DELIVERY_DAYS'] == '0'){ // $row['DELIVERY_DAYS'] = (($_MARCA=='GIVI' || $_MARCA=='KAPPA') ? "2-3" : "2-3"); // } $row['VARIANTNAME'] = @$record['NAME']; if(strlen($row['VARIANTNAME']) <= 20){//x gaec $row['VARIANTNAME'] = substr(str_replace(array("\r\n","\n"),array(' ',' '),@$row['DESCRIPTION']),0,200); } $record['variants'][] = $row; } @mssql_free_result($res); /* Altre info */ $record['otherInfo'] = array(); $record['otherInfo']['brandLink'] = '/it/brands/'.strtolower(convertString($record['BRAND'])).'/'; } if($debug){ dump($record,1,'record'); //dump($variant,1,'variant'); //dump($imageDetails,1,'$imageDetails'); } if(count($record['variants']) == 0) { //die("

Product is not available for sale

"); $record = array();//cado nella lista } } else{ $record = array();//altrimenti agg controllo sotto, tanti warnings... } //added for Page section title $section_title = ''; $sel_section_id = @$_GET['cat_section']; $section_list = array( 9=>'ABBIGLIAMENTO', 10=>'SCARPE DA MOTO', 11=>'STIVALI', 12=>'ACCESSORI', 13=>'TECHNICAL PARTS', 14=>'CASCHI E ACCESSORI', 987=>'GUANTI' ); $section_title = (($sel_section_id !='' && array_key_exists($sel_section_id,$section_list)) ? $section_list[$sel_section_id] : ''); /* ZB 30/08/2017 (FOGLIO DI LAVORO 30083) considero il parametro brands=1050%2C1054 per il titolo Per qui sposto qui il ritrovamento di tutti branda (era su T_10) */ $brands_title = $brands_title_first = ''; $brands = array(); $sezione=12421; /*Get Brand/manufacturer list*/ $sql = " SELECT DISTINCT P.MANUFACTURER,S.DESCRIZIONE, (select count(Product.ID) from Product right join PRODUCT_SECTION_ASSOCIATION ON PRODUCT_SECTION_ASSOCIATION.[Idsezione]=$sezione and PRODUCT_SECTION_ASSOCIATION.[ProductId]=[Product].ID WHERE PRODUCT.MANUFACTURER=p.MANUFACTURER AND PRODUCT.DELETED=0 and product.id IN(select product.id from PRODUCTVARIANT where PRODUCTVARIANT.productid=[Product].ID and PRODUCTVARIANT.ISPRESENT=1)) as PRODUCT_COUNT from PRODUCT P LEFT JOIN [Sezioni] S ON S.ID = P.MANUFACTURER LEFT JOIN PRODUCTVARIANT PV ON PV.PRODUCTID=P.ID LEFT JOIN PRODUCT_SECTION_ASSOCIATION PSA ON PSA.PRODUCTID=P.ID WHERE P.DELETED=0 AND PV.ISPRESENT=1 AND PSA.IDSEZIONE = $sezione and P.MANUFACTURER IS NOT NULL"; if(@$_GET['sizes'] !='') { //NULL does not work in IN clause $sizes = explode(',',$_GET['sizes']); if(in_array("'NULL'",$sizes)) { $sql .= " AND (PV.SIZE IN(".clear_input($_GET['sizes'],'dquotes').") OR PV.SIZE IS NULL)"; }else { $sql .= " AND PV.SIZE IN(".clear_input($_GET['sizes'],'dquotes').")"; } } //echo "
".$sql."
"; $res = mssql_query($sql,$Conn) or die('
Line '.__LINE__.' Query non eseguita: '.mssql_get_last_message()); while ($row = mssql_fetch_assoc ($res)) { $brands[$row['MANUFACTURER']] = $row;//zb uso assoc xche mi serve x google enx ecomm //$brands[] = $row; } //dump($brands,1,'$brands'); @mssql_free_result($res); if(@$_GET['brands'] != ''){ $brandsArr = explode(',',$_GET['brands']); //dump($brandsArr,1,'$brandsArr'); foreach($brandsArr as $brandId){ if(isset($brands[$brandId])){ $brands_title .= ','.$brands[$brandId]['DESCRIZIONE']; if($brands_title_first == ''){ $brands_title_first = $brands[$brandId]['DESCRIZIONE']; } } } } if($brands_title !='') $brands_title = substr($brands_title,1); if(!is_array($record) || count($record) == 0){ // Lista records if (strpos($_SERVER["REQUEST_URI"], "?sizes=") != FALSE) { ?> <?php echo $head_SEO_META_TITLE.' '.trim($section_title.' '.$brands_title);?> - Visenzi Motomarket ';?> 0){ $metaDesc = 'Scontato del '.$record['variants'][0]['promoSconto'].'% approfittane ora! '; } $metaDesc .= utf8_decode($record['SHORTDESCRIPTION']); $metaDesc .= '. Pagamenti sicuri, reso facile, garanzia 2 anni.'; ?> "/> <?php echo $titolo;?> " />" />
0){ //dett include($_SERVER["DOCUMENT_ROOT"].'/scheda_prodotto.php'); }else{ ?>

SWM

VISUALIZZA PER MARCA