Coder Social home page Coder Social logo

johnulist / osc2ps-product-export Goto Github PK

View Code? Open in Web Editor NEW

This project forked from glauberportella/osc2ps-product-export

0.0 2.0 0.0 712 KB

Export product data from OSCommerce Milestone 2.2 to Prestashop 1.6 store

License: MIT License

PHP 100.00%

osc2ps-product-export's Introduction

Export OSCommerce 2.2 Catalog to CSV and import to Prestashop 1.6+

Requirements

First of all your manufacturers must be already in your Prestashop store, with the same name as exists in your OSCommerce store.

Data export format

Data columns to export:

'p' is products table alias, 'pd' is products_description alias

- p.products_id
- p.products_code
- pd.products_name
- pd.products_description
- p.products_price
- p.products_quantity
- p.products_image

SQL for export data

The data is ordered by Manufacturer name, product code and product name columns in Ascending order.

SELECT m.manufacturers_name, p.products_id, p.products_code, pd.products_name, pd.products_description, p.products_price, p.products_quantity, p.products_image
FROM products p
LEFT JOIN products_description pd ON pd.products_id = p.products_id
LEFT JOIN manufacturers m ON m.manufacturers_id = p.manufacturers_id
WHERE p.products_status <> 0
ORDER BY m.manufacturers_name, p.products_code, pd.products_name ASC

Script to import exported data

Import steps:

  1. Creates a multi dimensional array with key = manufacturer name and value as an array with all products from that manufacturer;
  2. Traverse the created array, find the Manufacturer from Prestashop base, save its ID for futher use
  3. For each product of the manufacturer found Create the Prestashop Product instance, persist it; Load the image from OSCommerce url that points to products_image value; Persist the image to Prestashop base relative to the persisted product;

TODO LIST

None to add in the time it was created.

osc2ps-product-export's People

Contributors

glauberportella avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.