Git Product home page Git Product logo

Comments (9)

hakanensari avatar hakanensari commented on July 30, 2024

Sounds the same as #144. Could you upgrade the gem?

from peddler.

leoplct avatar leoplct commented on July 30, 2024

After run "bundle update peddler" I am receiving the same error

[GEM_ROOT]/gems/peddler-2.4.1/lib/peddler/headers.rb:53:in `find'

from peddler.

hakanensari avatar hakanensari commented on July 30, 2024

@leoplct The above change will hopefully squash this bug. Could you test with the master and see if it works?

from peddler.

leoplct avatar leoplct commented on July 30, 2024

It doesn't return error, but it can't parse the FlatFile. All values are nil.
Here the first row of Flat file .content(). It's UK marketplace localized in Chinese.

商品名称 商品描述 商品编码 卖家 SKU 价格 数量 开售日期 不适用项目 是否为商城中的商品 商品编码类型 不适用项目 商品备注 商品状况 不适用项目 不适用项目 不适用项目 ASIN1 不适用项目 不适用项目 国际配送 加急配送 不适用项目 商品编码 不适用项目 添加-删除 等待购买数量配送渠道 企业商品价格 数量折扣价格类型 数量下限 1 数量折扣价格 1 数量下限 2 数量折扣价格 2 数量下限 3 数量折扣价格 3 数量下限 4 数量折扣价格 4 数量下限 5 数量折扣价格 5 卖家配送组

Few possible solutions:

  1. A mapping between the localized header and English standard (eg. asin_colum = row.match(/english-name|french-name|german-name|chinese-name/)
  2. Set through API the Feed Processing Report Language to english (but I haven't find the method)

Mapping all possible columns would be too much, maybe only the main ones enough.
asin: row.field("asin1"),
sku: row.field("seller-sku"),
title: row.field("item-name"),
image: row.field('image-url'),
price: row.field('price').to_f,
quantity: row.field('quantity').to_i

from peddler.

hakanensari avatar hakanensari commented on July 30, 2024

It sounds like your flat file is not working with the formatting options in the existing parser. Could you attach the response body (the first couple of lines, at least) so I check its formatting?

from peddler.

leoplct avatar leoplct commented on July 30, 2024
商品名称	商品描述	商品编码	卖家 SKU	价格	数量	开售日期	不适用项目	是否为商城中的商品	商品编码类型	不适用项目	商品备注	商品状况	不适用项目	不适用项目	不适用项目	ASIN1	不适用项目	不适用项目	国际配送	加急配送	不适用项目	商品编码	不适用项目	添加-删除	等待购买数量	配送渠道	企业商品价格	数量折扣价格类型	数量下限 1	数量折扣价格 1	数量下限 2	数量折扣价格 2	数量下限 3	数量折扣价格 3	数量下限 4	数量折扣价格 4	数量下限 5	数量折扣价格 5	卖家配送组
Waterproof Sunshade Cover (180 * 180, Blue)	Material: Waterproof and UV resistant Oxford cloth <br><br> Color: green black blue <br><br> Product Size: <br> <br> 120 * 120CM weight 210g <br> <br> 150 * 150CM weight 290g <br><br> 180 * 180CM weight 380g <br><br> 200 * 200CM weight 460g	0645YNJ5NZ9	04-AFWM-8QDS	20.32	10	15/04/2020 15:15:46 BST		y	4			11				B2884WQWZY						4716528214404			0	DEFAULT				Migrated Template
Cover Rain And Snow Cover (242 * 160 * 100)	Color: green can be customized <br><br> Fabric main component content: waterproof 210D Oxford cloth <br><br> Dimensions: length * width * height cm <br><br> size and weight: <br><br> 242 * 162 * 100cm weight 950g <br><br> 308 * 138 * 89cm weight 950g <br><br> 213 * 132 * 70cm weight 590g <br><br> 180 * 120 * 70cm weight 500g <br><br> 126 * 126 * 74cm weight 430g <br><br> 123 * 61 * 72cm weight 280g <br><br> 115 * 115 * 70cm weight 280g <br><br> 315 * 160 * 70cm weight 910g <br><br> 230 * 165 * 70cm weight 720g <br><br> 210 * 140 * 70cm weight 600g <br><br> 210 * 110 * 70cm weight 540g <br><br> 205 * 104 * 71cm weight 510g <br><br> 170 * 71 * 94cm weight 450g <br><br> 160 * 160 * 70cm weight 560g <br><br> 150 * 150 * 70cm weight 510g <br><br> 152 * 104 * 71cm weight 420g <br><br> 250 * 250 * 90cm weight 1190g	0416XWWK0U5	02-5QLY-0EFL	35.29	10	16/04/2020 15:01:43 BST		y	4			11				B0234CWWCC						4714528214534			0	DEFAULT													Migrated Template

from peddler.

hakanensari avatar hakanensari commented on July 30, 2024

@leoplct, so strictly speaking, Peddler does parse the flat file, but the issue is you're not able to use the English headers you would expect MWS to return—e.g. you're getting '卖家 SKU' in place of 'seller-sku'.

Yes, this is annoying, but I think it's best you handle this outside of Peddler as we don't have the data to abstract this properly for every locale and report type. I'm quite sure there are other locales and report types that similarly return translated headers.

Also, I don't think there's a way to ask the API to return the standard English headers. But maybe you can find another report type with the data you need that has less-legacy formatting?

from peddler.

leoplct avatar leoplct commented on July 30, 2024

Ok, Do you know what's the simplest report to get all ASIN/SKUs for FBA+MFN with inventory > 0 ?

I only need these attributes:

  • asin
  • seller-sku
  • item-name
  • image-url
  • price

from peddler.

hakanensari avatar hakanensari commented on July 30, 2024

@leoplct no answer off the top of my head—you have to go through the various inventory report types if you haven't already done so.

from peddler.

Related Issues (20)

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.