fetchByAssoc ( $GLOBALS ['db']->query ( "select srp_price_eur,product_category_id,srp_price,name,code,product_picture,packing_front_picture, ean, ean2 from ecmproducts where id='" . $id . "' and deleted='0'" ) ); if ($price == "srp_price" || $price == "") { if ($symbol == 'PLN') $price = number_format ( $r ['srp_price'], 2, ',', ' ' ); else if ($symbol == 'EUR') $price = number_format ( $r ['srp_price_eur'], 2, ',', ' ' ); $price.=' '.$symbol; } else if ($price == "pricebook_price") { $pr = $GLOBALS ['db']->fetchByAssoc ( $GLOBALS ['db']->query ( "SELECT pp.price, p.currency_value FROM ecmpricebooks_ecmproducts as pp INNER JOIN ecmpricebooks AS p ON pp.ecmpricebook_id=p.id where pp.ecmpricebook_id='" . $_SESSION ['pricebook_id'] . "' and pp.ecmproduct_id='" . $id . "' and pp.deleted='0'" ) ); if ($pr['currency_value']=='' || is_null($pr['currency_value'])) $pr['currency_value'] = 1; if ($symbol != 'PLN') $pr['price'] = $pr['price'] / $pr['currency_value']; $price = format_number($pr['price']); $price.=' '.$symbol; } else { $pr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT pp.price, p.exchange_rate_id FROM ecmprices_ecmproducts AS pp INNER JOIN ecmprices AS p ON pp.ecmprice_id=p.id WHERE pp.ecmprice_id='$price' AND pp.ecmproduct_id='$id'")); $c = new Currency; $c->retrieve($pr['exchange_rate_id']); $symbol = $c->iso4217; unset($c); $price = format_number($pr['price']).' '.$symbol; } if ($parent_type=='EcmQuotes') { $pr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT price_netto FROM ecmquoteitems WHERE id='$parent_item_id' AND deleted='0'")); $price = format_number($pr['price_netto']).' '.$symbol; } $product_picture = 'modules/EcmProducts/upload/images/big/' . $r ['product_picture']; if (file_exists ( 'modules/EcmProducts/upload/images/big/' . $r ['packing_front_picture'] )) $packing_front_picture = 'modules/EcmProducts/upload/images/big/' . $r ['packing_front_picture']; $rr = $GLOBALS ['db']->fetchByAssoc ( $GLOBALS ['db']->query ( "select ean,long_description,short_description from ecmproduct_language where ecmproduct_id='" . $id . "' and deleted='0' and lower(language)='" . $lang . "'" ) ); $ld = $rr ['long_description']; if (! $rr ['ean']) { $rrr = $GLOBALS ['db']->fetchByAssoc ( $GLOBALS ['db']->query ( "select ean from ecmproduct_language where ecmproduct_id='" . $id . "' and language='pl'" ) ); $rr ['ean'] = $rrr ['ean']; } if ($ean == 2) { $r ['ean'] = $r ['ean2']; } if ($ean == 0) { $r['ean'] = ''; } if ($rr ['short_description'] && $rr ['short_description'] != '') $r ['name'] = $rr ['short_description']; //create description $tmp = explode(' ', $ld); $description = ''; $paste = false; foreach ($tmp as $line) { if ($paste && strpos($line,'strong')!=false) break; if ($paste) $description.=$line; if (strpos($line, trim($description_label))) $paste = true; } $specification = ''; $paste = false; foreach ($tmp as $line) { if ($paste && strpos($line,'strong')!=false) break; if ($paste) $specification.=$line; if (strpos($line, trim($specification_label))) $paste = true; } //$specification = str_replace("", "<<<", $specification); //$specification = str_replace("/", "//", $specification); //$specification = str_replace("<<<<", "", $specification); $html = '
|
'.$price.' |
|
' . html_entity_decode($r['name']) . '
|
|