Thomasis Posted August 11, 2009 Share Posted August 11, 2009 Ahoj, při generaci xml pro zbozi.cz se saptne generuje URL výrobku, tenhle script pouzivam. <?php $shopUrl = 'http://abito.cz'; // adresa shopu včetně http:// include(dirname(__FILE__).'/../config/config.inc.php'); // cesta ke config souboru error_reporting(0); $p=Product::getProducts(3, 0, 0, 'id_product', 'desc', false); // ceština je v databázi zapsaná pod číslem 3 $products=Product::getProductsProperties(3, $p); // ceština je v databázi zapsaná pod číslem 3 header("Content-Type: text/xml"); echo '<?xml version="1.0" encoding="utf-8"?> '; foreach ($products as $row) { $img=Product::getCover($row['id_product']); echo ' '.str_replace("&", "&", $row['name']).' '.str_replace("&", "&",strip_tags($row['description_short'])).' '.$shopUrl.''.$row['link'].' '.$shopUrl.'/img/p/'.$row['id_product'].'-'.$img['id_image'].'.jpg '.($row['price']*1).' 0 '; } echo ''; ?> A v xml se url u všech výrobků zobrazuje takhle. http://abito.cz_PS_BASE_URL_/22-luxusni-dvoubarevne-saty.html Nevíte kde se tam bere to _PS_BASE_URL_ ? Link to comment Share on other sites More sharing options...
krychlicka Posted October 2, 2009 Share Posted October 2, 2009 mam presne stejny problem..nejaky tip jak to vyresit (krome toho ze ce vyslednem xml to odmazat) Link to comment Share on other sites More sharing options...
armur Posted October 3, 2009 Share Posted October 3, 2009 Co to zkusit v hledání nebo třeba http://www.prestashop.com/forums/viewthread/5398/P75/xml_genertor_zbozi_dot_czjinak tohle by mělo šlapat <?php $shopUrl = 'http://www.presta.bazarhudebnin.cz'; // adresa shopu včetně http:// include(dirname(__FILE__).'/config/config.inc.php'); // cesta ke config souboru include(dirname(__FILE__).'/init.php'); error_reporting(0); $p=Product::getProducts(3, 0, 0, 'id_product', 'desc', false); // ceština je v databázi zapsaná pod číslem 3 $products=Product::getProductsProperties(3, $p); // ceština je v databázi zapsaná pod číslem 3 header("Content-Type: text/xml"); echo '<?xml version="1.0" encoding="utf-8"?> '; foreach ($products as $row) { $img=Product::getCover($row['id_product']); echo ' '.str_replace("&", "&", $row['name']).' '.str_replace("&", "&",strip_tags($row['description_short'])).' '.$row['link'].' '.$shopUrl.'/img/p/'.$row['id_product'].'-'.$img['id_image'].'.jpg '.($row['price']*1).' 0 '; } echo ''; ?> 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