johnytapia Posted February 12, 2011 Share Posted February 12, 2011 Gdyby ktoś potrzebował pliczek xml dla sklepy24.pl to ten mały skrypcik się przyda.Kodzik na bazie http://www.prestashop.com/forums/viewthread/71267/#312325wystarczy go odpalić w przeglądarce: http://adrestwojegosklepu/skrypcik.php i zapisać wynik jako xmlKod: <?php $shopUrl = 'adres www sklepu'; $langHr = 4; include(dirname(__FILE__).'/config/config.inc.php'); require_once(dirname(__FILE__).'/init.php'); error_reporting(0); $p=Product::getProducts(4, 0, 0, 'id_product', 'desc', false); // number 4 is id of language in database $products=Product::getProductsProperties(4, $p); // number 4 is id of language in database header("Content-Type: text/xml"); echo <?xml version="1.0" encoding="utf-8"?> '; foreach ($products as $row) { if ($row['active']){ $img=Product::getCover($row['id_product']); echo ' '.str_replace("&", "&", $row['name']).' '.$shopUrl.''.$row['link'].' '.str_replace("&", "&", $row['manufacturer_name']).' '.($row['price']).' '.str_replace("&", "&", $row['category']).' '.$shopUrl.'/img/p/'.$row['id_product'].'-'.$img['id_image'].'.jpg '.str_replace("&", "and", strip_tags($row['description_short'])).' '; } } echo ''; ?> Link to comment Share on other sites More sharing options...
johnytapia Posted February 12, 2011 Author Share Posted February 12, 2011 Widzę, że jest jeden drobny problem z kategoriami. Mianowicie wygląda na to, że skrypt wyciąga ps_category_lang>link_rewrite zamiast nazwy kategorii z ps_category_lang>name.Wie ktoś jak to rozwiązać ?? 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