Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.


  • Content count

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. thommenl

    PHP + SQL - Replace category ID with a name

    I had while ($exportList = tep_db_fetch_array($exportQuery)) { while ($exportList1 = tep_db_fetch_array($exportQuery1)) { if ($exportList['pi'] == $exportList1['categories_id']) { $exportList['pi'] = $exportList1['cn']; // break; } } // print_r($exportList).PHP_EOL; // var_dump($exportList); fputcsv($output, $exportList, ";"); } but the code only worked for the first cycle of the outer loop.
  2. I have script <?php require('includes/application_top.php'); # Output headers so that the file is downloaded rather than displayed header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename=data.csv'); # Create a file pointer connected to the output stream $output = fopen('php://output', 'w'); try { # SQL for products with products extra images $exportSQL = "SELECT c.categories_id, c.parent_id AS pi, cd.categories_name AS cn FROM categories c LEFT JOIN categories_description cd ON c.categories_id = cd.categories_id WHERE cd.language_id = 2"; $exportQuery = tep_db_query($exportSQL); if (tep_db_num_rows($exportQuery) > 1) { while ($exportList = tep_db_fetch_array($exportQuery)) { // print_r($exportList).PHP_EOL; // var_dump($exportList); fputcsv($output, $exportList, ";"); } } } catch (PDOException $e) { print "Error: " . $e->getMessage(); die(); } Now I need to add the function of replacing the parent's ID with the name of the category. I have tried many things but I am not familiar with osCommerce. Please help.
  3. I want to migrate categories to PrestaShop. For product migration, I have significantly modified the file → https://gist.github.com/stefanbc/1a2046d996ee60765b4a. Now I'm looking for a way to migrate categories. Someone has an almost ready solution or hints?