dongshuo1856
2015-05-21 14:43
浏览 28
已采纳

PrestaShop:从XLS导入?

Is there a possibility to import XLS Files into Prestashop? I would imagine myself a Script where I define which rows (as an Example A1-A300 should be Names of the articles, etc...) are what (Like name, price, Tax, etc...).

How could I realise that? I hope there is a possibility and I would appreciate if anyone could get ma on the right path.

图片转代码服务由CSDN问答提供 功能建议

是否有可能将XLS文件导入Prestashop? 我会想象自己是一个脚本,我在其中定义哪些行(例如A1-A300应该是文章的名称等等)是什么(如名称,价格,税等等)。

我怎么能意识到这一点? 我希望有可能,如果有人能够在正确的道路上获得成功,我将不胜感激。

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duandong7980 2015-05-21 18:22
    已采纳

    PrestaShop doesn't support excel files, only simple data tables like .csv. This is because excel files are too complicated, they can by whole programs by themselves.

    However, if you're working for a client or your XLS files are just simple data, then surely you can convert XLS to CSV before import.

    You just need to make an override for AdminImportController::ajaxProcessUploadCSV

    and basically "intercept file upload". Get the uploaded file and convert it to CSV using this library:

    https://github.com/PHPOffice/PHPExcel

    Then just return are the right values in your override to simulate that "everything is running normal" (basically trick PrestaShop :)) .

    It is definitely doable, I've created such module for a client, PHPExcel gave us the ability to work with cells before saving them to CSV.

    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • dongwo1234 2015-05-25 10:47

    If you need to import products form Excel without converting to CSV, there is extension, Store Manager for PrestaShop - https://www.prestashopmanager.com/free-download/

    It is paid, but you can do the task with 2-week version without any fees.

    评论
    解决 无用
    打赏 举报