Problem

Orders downloading from Prestashop are coming with duplicate items


Cause

Prestashop 1.5 has introduced a multi store functionality. That means everything in ps_product_lang table will be duplicated. This is where product titles, names and descriptions are stored.


Solution

  • Go to Settings -> Channel Integration
  • Select your Prestashop Channel
  • Click Config
  • Click Query Designer¬†
  • Select GetOrderItemsQuery
  • Modify the query as specified below:


INNER JOIN ps_product_lang pl ON pl.id_product = od.product_id AND pl.id_lang = 1

(Change pl.lang=1 to anything else, if you are using other languages)


Replace it with:


INNER JOIN ps_product_lang pl ON pl.id_product = od.product_id AND pl.id_lang = 1 AND pl.id_shop=1

(Replace pl.id_shop=1 with another active multistore ID )