Magento xml 数据馈送帮助

发布于 2024-11-04 20:06:19 字数 4300 浏览 1 评论 0原文

我正在尝试在 magento 中导入产品的 xml 数据源。尝试导入它,但似乎它必须位于 MSOffice-xml 或 cvs 文件中才能成功导入它。我尝试将 xml 文件解析为 cvs,但只能解析 xml 文件的一部分。我只能解析除营养部分之外的所有内容。我使用 stackoverflow 上找到的 xml2cvs 代码。有关如何成功导入此 xml 数据源的任何建议。

 <product>
<STOCK_CODE>010003</STOCK_CODE>
<UPC>705077000440</UPC>
<Basic_Description>GABA 100GM</Basic_Description>
<Brand>AST Sports Science</Brand>
<ProductLine/>
<ItemName>GABA</ItemName> 
<Title>AST Sports Science GABA</Title> 
<Flavor/>
<Supplier_Number>1</Supplier_Number>
<Supplier_Name>AST SPORTS SCIENCE</Supplier_Name>
<Primary_Category>Amino Acids</Primary_Category>
<General_Category>Supplements</General_Category>
<WHOLESALE_PRICE>17.47</WHOLESALE_PRICE>
<RETAIL_PRICE>24.95</RETAIL_PRICE>
<LIST_DATE>2004-05-12</LIST_DATE>
<DISC/>
<CLT_QOH>Yes</CLT_QOH>
<FRE_QOH>Yes</FRE_QOH>
<MES_QOH>Yes</MES_QOH>
<STR_QOH>Yes</STR_QOH>
<WND_QOH>Yes</WND_QOH>
<ORL_QOH>Yes</ORL_QOH>
<HasNutrition>1</HasNutrition>
<ValuePreparedCount>0</ValuePreparedCount>
<Address>120 Capital Drive Golden, CO 80401</Address>
<Copyright>2007 AST Sports Science, Inc.</Copyright>
<ItemSize>100</ItemSize>
<ItemMeasure>g</ItemMeasure>
<Height>4.625</Height>
<Width>2.375</Width>
<Depth>2.375</Depth>
<ProductWeight/>
<MASS>0.313</MASS>
<ExtendedSize>100 g (3.53 oz)</ExtendedSize>
<CASE_QUANTITY>12</CASE_QUANTITY>
<Description>GABA, Growth Hormone Potentiator</Description>
<ProductDetails>GABA is an amino acid classified as a neurotransmitter. Studies have shown GABA to play a key role in the secretion of Growth Hormone. The principle anabolic actions of Growth Hormone including the stimulation of amino acid transport, simulation of protein synthesis reduction of body-fat and the proliferation of cell growth. AST Sports Science selectively imports GABA under rigid quality control conditions. Each batch is HPLC Certified and Laboratory Tested for purity and potency. GABA is a naturally occurring amino acid classified as a neurotransmitter. Some individuals may experience a minor tingling of skin and/ or slight shortness of breath shortly after taking GABA. This is characteristic of this amino acid and quickly subsides.</ProductDetails>
<Directions>For adults only. As a dietary supplement, take three to five grams mixed with 8 ounce of water, juice or protein shake approximately 30 minutes before sleep.</Directions>
<Ingredients/>
<DrugInteractions/>
<Warnings/>
<PostDate>2009-08-25</PostDate>
<HTML>http://www.ast-ss.com</HTML>
  <thumbnail_url>https://secure.europadatafeed.com/images/50/705077000440.gif</thumbnail_url>
  <image_url>https://secure.europadatafeed.com/images/250/705077000440.jpg</image_url>
  <logo_url>https://secure.europadatafeed.com/images/logos/ast.gif</logo_url>
<image500_URL>https://secure.europadatafeed.com/images/500/705077000440.jpg</image500_URL>
<MAP_Price/> 
<image_name>705077000440</image_name>
<image100_URL>https://secure.europadatafeed.com/images/100/705077000440.jpg</image100_URL>

<SEA_QOH>No</SEA_QOH>



    <NUTRIENTS>

  <Nutrient>
    <AddedItem/> 
    <ISORCONTAINS>0</ISORCONTAINS>
    <NAME>Gamma Aminobutyric Acid</NAME>
    <NUTRIENTMASTERID>6260</NUTRIENTMASTERID>
    <OLDVALUEPREPAREDTYPE>0</OLDVALUEPREPAREDTYPE>
    <PCT/>
    <QUANTITY>3.0</QUANTITY>
    <SERVINGSIZETEXT>3</SERVINGSIZETEXT>
    <SERVINGSIZEUOM>Scoops</SERVINGSIZEUOM>
    <SERVINGSPERCONTAINER>33</SERVINGSPERCONTAINER>
    <TYPE>1</TYPE>
    <DETAILS/>
    <UOM>g</UOM>
    <UPC>705077000440</UPC>
    <VALUEPREPAREDTYPE>0</VALUEPREPAREDTYPE>

    </Nutrient>  

</NUTRIENTS>

</product>

I'm trying to import an xml datafeed of products in magento. Try importing it but is seems it has to been in MSOffice-xml or cvs file to succesfully import it. I try parsing the xml file to cvs, but was only able to parse a section of the xml file. I was only able to parse everything but the NUTRIENTS section. I use the xml2cvs code found on stackoverflow. Any suggestion of how to succesfully import this xml datafeed.

 <product>
<STOCK_CODE>010003</STOCK_CODE>
<UPC>705077000440</UPC>
<Basic_Description>GABA 100GM</Basic_Description>
<Brand>AST Sports Science</Brand>
<ProductLine/>
<ItemName>GABA</ItemName> 
<Title>AST Sports Science GABA</Title> 
<Flavor/>
<Supplier_Number>1</Supplier_Number>
<Supplier_Name>AST SPORTS SCIENCE</Supplier_Name>
<Primary_Category>Amino Acids</Primary_Category>
<General_Category>Supplements</General_Category>
<WHOLESALE_PRICE>17.47</WHOLESALE_PRICE>
<RETAIL_PRICE>24.95</RETAIL_PRICE>
<LIST_DATE>2004-05-12</LIST_DATE>
<DISC/>
<CLT_QOH>Yes</CLT_QOH>
<FRE_QOH>Yes</FRE_QOH>
<MES_QOH>Yes</MES_QOH>
<STR_QOH>Yes</STR_QOH>
<WND_QOH>Yes</WND_QOH>
<ORL_QOH>Yes</ORL_QOH>
<HasNutrition>1</HasNutrition>
<ValuePreparedCount>0</ValuePreparedCount>
<Address>120 Capital Drive Golden, CO 80401</Address>
<Copyright>2007 AST Sports Science, Inc.</Copyright>
<ItemSize>100</ItemSize>
<ItemMeasure>g</ItemMeasure>
<Height>4.625</Height>
<Width>2.375</Width>
<Depth>2.375</Depth>
<ProductWeight/>
<MASS>0.313</MASS>
<ExtendedSize>100 g (3.53 oz)</ExtendedSize>
<CASE_QUANTITY>12</CASE_QUANTITY>
<Description>GABA, Growth Hormone Potentiator</Description>
<ProductDetails>GABA is an amino acid classified as a neurotransmitter. Studies have shown GABA to play a key role in the secretion of Growth Hormone. The principle anabolic actions of Growth Hormone including the stimulation of amino acid transport, simulation of protein synthesis reduction of body-fat and the proliferation of cell growth. AST Sports Science selectively imports GABA under rigid quality control conditions. Each batch is HPLC Certified and Laboratory Tested for purity and potency. GABA is a naturally occurring amino acid classified as a neurotransmitter. Some individuals may experience a minor tingling of skin and/ or slight shortness of breath shortly after taking GABA. This is characteristic of this amino acid and quickly subsides.</ProductDetails>
<Directions>For adults only. As a dietary supplement, take three to five grams mixed with 8 ounce of water, juice or protein shake approximately 30 minutes before sleep.</Directions>
<Ingredients/>
<DrugInteractions/>
<Warnings/>
<PostDate>2009-08-25</PostDate>
<HTML>http://www.ast-ss.com</HTML>
  <thumbnail_url>https://secure.europadatafeed.com/images/50/705077000440.gif</thumbnail_url>
  <image_url>https://secure.europadatafeed.com/images/250/705077000440.jpg</image_url>
  <logo_url>https://secure.europadatafeed.com/images/logos/ast.gif</logo_url>
<image500_URL>https://secure.europadatafeed.com/images/500/705077000440.jpg</image500_URL>
<MAP_Price/> 
<image_name>705077000440</image_name>
<image100_URL>https://secure.europadatafeed.com/images/100/705077000440.jpg</image100_URL>

<SEA_QOH>No</SEA_QOH>



    <NUTRIENTS>

  <Nutrient>
    <AddedItem/> 
    <ISORCONTAINS>0</ISORCONTAINS>
    <NAME>Gamma Aminobutyric Acid</NAME>
    <NUTRIENTMASTERID>6260</NUTRIENTMASTERID>
    <OLDVALUEPREPAREDTYPE>0</OLDVALUEPREPAREDTYPE>
    <PCT/>
    <QUANTITY>3.0</QUANTITY>
    <SERVINGSIZETEXT>3</SERVINGSIZETEXT>
    <SERVINGSIZEUOM>Scoops</SERVINGSIZEUOM>
    <SERVINGSPERCONTAINER>33</SERVINGSPERCONTAINER>
    <TYPE>1</TYPE>
    <DETAILS/>
    <UOM>g</UOM>
    <UPC>705077000440</UPC>
    <VALUEPREPAREDTYPE>0</VALUEPREPAREDTYPE>

    </Nutrient>  

</NUTRIENTS>

</product>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云胡 2024-11-11 20:06:19

导入 Magento 是一件非常棘手的事情 - 导入到 Magento 必须几乎 100% 完美。我建议使用 XML,因为它更容易创建和管理。 CSV 很旧,我在引号、空格特殊字符方面遇到了无尽的问题,后面无尽的痛苦。

我一直断断续续地致力于我的这个私人项目,但我正在转移我的项目并制作新网站。

如果您有兴趣,请看这里以获取一些启示。

http://code.google.com/p/magentobridge/wiki/Hello

有视频和一些教程可能会对您有所帮助。该软件尽管经过多年的业余开发,但在某些方面仍然相当不稳定。

我很乐意为您提供一个简单的解决方案,但它太复杂了,很多事情都会出错。

现在 Magento 使用 API - 但设置它是另一个痛苦..

Importing into Magento is a very tricky thing to do- it has to be almost 100% perfect to import into Magento. I suggest using XML because it easier to create and manage. CSV is old and i have had endless problems with quotes, spaeces special character endless pain in the rear.

I have been working on and off on this private project of mine but i am in the middle of moving my projects around and making new sites.

If you are interested take a look here for some enlightment.

http://code.google.com/p/magentobridge/wiki/Hello

There are videos and some tutorials that might help you.The software despite in many years of development on the sideline is quite unstable in some areas.

I would love to help you here with a simple solution.. but its just so complex and so many things go wrong.

Now a days Magento Uses an API - but setting it up is another pain..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文