tozi Posted June 23, 2014 Share Posted June 23, 2014 (edited) Hi all, i have a problem with xml feed script. Here is the error. http://73393.w93.wedos.ws/utils/heureka.php I do not understand at all how is it a mistake. Script works for me on another eShop great. Here is the script: <?php require 'dibi.php'; dibi::connect(array( 'driver' => 'mysqli', 'host' => '', 'username' => '', 'password' => '', 'database' => '', 'charset' => 'utf8', 'lazy' => 'true', )); error_reporting(E_ALL); ini_set("display_errors", 1); //Definice hlavičky XML souboru header("Content-type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; ?> <SHOP> <? // Výpis produktů v XML formátu pro Zboží.cz $produkty = dibi::select('*') ->from('psb_product') ->innerJoin('psb_product_lang')->using('(id_product)') ->innerJoin('psb_image')->using('(id_product)') ->where('active = %i', 1) ->where('cover = %i', 1) ->where('id_lang = %i', 2) ->where('price > %i', 10) ->execute(); foreach ($produkty as $pro) { $cat = dibi::select('id_category_default') ->from('psb_product') ->where('id_product = %i', $pro['id_product']) ->fetchSingle(); $catname = dibi::select('name') ->from('psb_category_lang') ->where('id_category = %i', $cat) ->fetchSingle(); /*if($cat==3)$catname = 'Auto-moto | Autodoplňky | Autobaterie'; if($cat==4)$catname = 'Elektronika | Baterie | Olověné baterie'; if($cat==5)$catname = 'Auto-moto | Příslušenství pro motocykly | Baterie pro motocykly'; if($cat==8)$catname = 'Auto-moto | Autodoplňky | Nabíječky a startovací boxy'; if($cat==9)$catname = 'Auto-moto | Autodoplňky | Nabíječky a startovací boxy';*/ $desc = str_replace('<h2>', '', $pro['description']); $desc = str_replace('</h2>', '', $desc); $desc = str_replace(' ', '', $desc); $cesta = chunk_split($pro['id_image'], "1", "/"); // vypíše '11.22.33.44.' if($pro['id_tax_rules_group']==1){ $svat = $pro['price'] * 1.21; }elseif($pro['id_tax_rules_group']==2){ $svat = $pro['price'] * 1.15; }else{ $svat = $pro['price']; } $svat = round($svat); ?> <SHOPITEM> <PRODUCTNAME><![CDATA[<?=$pro['name'];?>]]></PRODUCTNAME> <DESCRIPTION><![CDATA[<?=$desc;?>]]></DESCRIPTION> <URL>http://73393.w93.wedos.ws/index.php?id_product=<?=$pro['id_product'];?>&controller=product&id_lang=2 </URL> <ITEM_TYPE>new</ITEM_TYPE> <CATEGORYTEXT><?=$catname?></CATEGORYTEXT> <IMGURL>http://73393.w93.wedos.ws/img/p/<?=$cesta?><?=$pro['id_image']?>-large_default.jpg </IMGURL> <PRICE><?=$pro['price']?></PRICE> <DELIVERY_DATE>0</DELIVERY_DATE> <?php if($pro['id_tax_rules_group']==1){ echo '<VAT>21</VAT>'; }elseif($pro['id_tax_rules_group']==2){ echo '<VAT>15</VAT>'; }else{ echo '<VAT>21</VAT>'; } ?> <PRICE_VAT><?=$svat?></PRICE_VAT> <TOLLFREE>0</TOLLFREE> </SHOPITEM> <? }?> </SHOP> I tried delete <CATEGORYTEXT><?=$catname?></CATEGORYTEXT> then script works. But i need categorytext Edited June 23, 2014 by tozi (see edit history) Link to comment Share on other sites More sharing options...
tozi Posted June 23, 2014 Author Share Posted June 23, 2014 Ok it is solved. solution: <CATEGORYTEXT><![CDATA[<?=$catname?>]]></CATEGORYTEXT> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now