Jump to content

lakombrada

Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Location
    Bratislava

lakombrada's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. From 1.4.6.2 to 1.6.0.9: products without images(files) php script: http://www.prestashop.com/forums/topic/392900-import-products-from-14-to-16-php-script/
  2. !!!!!!!!!!! WARNING !!!!!!!!!!!!! !! this script delete few tables on target database please create a backup !!! !!!!!!!!!!! WARNING !!!!!!!!!!!!! This is my script to transfer products from 1.4 to 1.6 without image files. The database must be on the same server. 1. Delete the tables in the new database 2. copy the cell column of the tables from the old to the new about 30 000 products - 45 sec. ... maybe it helps someone;) <?php echo "Start - " .date("Y-m-d H:i:s")."<br>"; $servername = "localhost"; $username = "root"; $password = ""; // Create connection $conn = new mysqli($servername, $username, $password); // Check connection if ($conn->connect_error) { die("Connection failed: <br>".$conn->connect_error); } echo "Connected successfully<br>"; function runQuery($query, $conn) { if ($conn->query($query) === true) { echo "New record created successfully<br>"; } else { echo "Error: ".$query."<br>".$conn->error."<br>"; } } $DB_source = "`presta`"; $DB_target = "`prestashop_1.6.0.9`"; $id_lang_source = 6; $id_lang_target = 2; $tabs = array( "ps_product", "ps_product_shop", "ps_product_supplier", "ps_product_lang", "ps_stock_available", "ps_category_product", "ps_image", "ps_image_lang", "ps_image_shop"); for ($i = 0; $i < count($tabs); $i++) { $query = "DELETE FROM ".$DB_target.".".$tabs[$i].";"; runQuery($query, $conn); $query = "ALTER TABLE ".$DB_target.".".$tabs[$i]." AUTO_INCREMENT = 0;"; runQuery($query, $conn); } //////////////////////////////////////////// $columns = "id_product,id_supplier,id_manufacturer,id_category_default, id_tax_rules_group,ean13,ecotax,quantity,price,wholesale_price, reference,supplier_reference,active,date_add,date_upd"; $columns2 = "id_product,id_supplier,id_manufacturer,id_category_default+1, id_tax_rules_group,ean13,ecotax,quantity,price,wholesale_price, reference,supplier_reference,active,date_add,date_upd"; $query = " INSERT INTO ".$DB_target.".`ps_product` (".$columns.") SELECT ".$columns2." FROM ".$DB_source.".`ps_product`"; runQuery($query, $conn); //////////////////////////////////////////// $columns = "`id_product`, `id_shop`, `id_category_default`, `id_tax_rules_group`, `ecotax`, `price`, `wholesale_price`, `active`, `date_add`, `date_upd`"; $columns2 = "`id_product`, 1, `id_category_default`, `id_tax_rules_group`, `ecotax`, `price`, `wholesale_price`, `active`, `date_add`, `date_upd`"; $query = " INSERT INTO ".$DB_target.".`ps_product_shop` (".$columns.") SELECT ".$columns2." FROM ".$DB_target.".`ps_product`"; runQuery($query, $conn); //////////////////////////////////////////// $columns = "`id_product`, `id_supplier`, `product_supplier_reference`, `product_supplier_price_te`, `id_currency`"; $columns2 = "`id_product`, `id_supplier`, `supplier_reference`, `wholesale_price`, 1"; $query = " INSERT INTO ".$DB_target.".`ps_product_supplier` (".$columns.") SELECT ".$columns2." FROM ".$DB_target.".`ps_product`"; runQuery($query, $conn); //////////////////////////////////////////// $columns = "id_product,id_lang,description,description_short,link_rewrite,meta_description, meta_keywords,meta_title,name,available_now,available_later"; $columns2 = "id_product,".$id_lang_target.",description,description_short,link_rewrite,meta_description, meta_keywords,meta_title,name,available_now,available_later"; $query = " INSERT INTO ".$DB_target.".`ps_product_lang` (".$columns.") SELECT ".$columns2." FROM ".$DB_source.".`ps_product_lang` WHERE `id_lang`=".$id_lang_source; runQuery($query, $conn); //////////////////////////////////////////// $columns = "`id_product`, `id_product_attribute`, `id_shop`, `id_shop_group`, `quantity`, `out_of_stock`"; $columns2 = "`id_product`, 0, 1, 0, `quantity`, 2"; $query = " INSERT INTO ".$DB_target.".`ps_stock_available` (".$columns.") SELECT ".$columns2." FROM ".$DB_target.".`ps_product`"; runQuery($query, $conn); //////////////////////////////////////////// $columns = "`id_category`, `id_product`"; $columns2 = "`id_category_default`, `id_product`"; $query = " INSERT INTO ".$DB_target.".`ps_category_product` (".$columns.") SELECT ".$columns2." FROM ".$DB_target.".`ps_product`"; runQuery($query, $conn); //////////////////////////////////////////// $columns = "`id_image`, `id_product`,`position`,`cover`"; $query = " INSERT INTO ".$DB_target.".`ps_image` (".$columns.") SELECT ".$columns." FROM ".$DB_source.".`ps_image`"; runQuery($query, $conn); //////////////////////////////////////////// $columns = "`id_image`, `id_lang`,`legend`"; $columns2 = "`id_image`, ".$id_lang_target.",`legend`"; $query = " INSERT INTO ".$DB_target.".`ps_image_lang` (".$columns.") SELECT ".$columns2." FROM ".$DB_source.".`ps_image_lang` WHERE `id_lang`=".$id_lang_source; runQuery($query, $conn); //////////////////////////////////////////// $columns = "`id_image`, `id_shop`,`cover`"; $columns2 = "`id_image`, 1,1"; $query = " INSERT INTO ".$DB_target.".`ps_image_shop` (".$columns.") SELECT ".$columns2." FROM ".$DB_source.".`ps_image`"; runQuery($query, $conn); if ($product["image"] != "" && $_SESSION["insert_images"] == true) $this->insertProductImage($pid, $product["image"], 'add'); $conn->close(); echo "End - " .date("Y-m-d H:i:s"); ?>
  3. http://www.prestashop.com/forums/topic/201253-mass-updater/
  4. Pripravil som pre mna velmi dolezity modul, ak mate e-shop s mnozstvom produktov, casto sa meniacich, napr. importom, potom iste potesi... - vie hromadne zmenit vyrobcu pre oznacene produkty - editovat masovo vsetky vlastnosti produktu (meno, kod, mnozstvo, hmotnost, ceny, meta data... - hromadne premiestnit do kategorie oznacene produkty, aj so spatnym zapisom do podkategorii - hromadne doplnit produkt do kategorie a podkategorii Vyrobene a testovane v 1.4.8.2 - testovane v 1.5.1, 1.5.2 kto by mal zaujem piste e-mail: lakombrada ( @ ) centrum.sk
  5. edit only module files: http://www.prestashop.com/forums/topic/20501-how-do-i-add-more-than-1-special-in-the-blockspecials-module/page__st__20__p__818539?do=findComment&comment=818539
  6. try this: working in 1.4.7.0 change only /modules/blockspecials/blockspecials.tpl from: {if $special} <ul class="products"> ..... <span class="price">{if !$priceDisplay}{displayWtPrice p=$special.price}{else}{displayWtPrice p=$special.price_tax_exc}{/if}</span> </li> </ul> <p> ... to: {if $specials !== false} <ul class="products"> {foreach from=$specials item='special' name='products'} <li class="product_image"> ..... <span class="price">{if !$priceDisplay}{displayWtPrice p=$special.price}{else}{displayWtPrice p=$special.price_tax_exc}{/if}</span> </li> {/foreach} </ul> <p> ... and /modules/blockspecials/blockspecials.php from: if (!$special = Product::getRandomSpecial((int)($params['cookie']->id_lang)) AND !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY')) return; $smarty->assign(array( 'special' => $special, to: if (!$specials = Product::getRandomSpecial((int)($params['cookie']->id_lang)) AND !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY')) return; $specials = array(); for ($i = 1; $i <= 10; $i++) $specials[] = Product::getRandomSpecial((int)($params['cookie']->id_lang)); $smarty->assign(array( 'specials' => $specials, in function for ($i = 1; $i <= 10; $i++) $i <= 10 10 is number of products
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More