0

这是我的 Volusion 项目插入方法,它依赖于 Rails 的 HTTParty gem。<PhotoURL_Large>它适用于发布没有照片的项目,以及使用和<PhotoURL_Small>XML 标签发布带有单张照片的项目。

def self.post_volusion_item(hide_product, product_code, product_name, product_description, availability, custom_field1, custom_field2, enable_options_inv_control, free_shipping_item, height, length, width, metatag_description, metatag_title, photo_alt_text, photo_xml, product_category, product_price, product_weight, metatag_keywords)
  encrypted_password = ENV['VOLUSION_PASSWORD']
  post_url = "https://WEBSITE-HERE/net/WebService.aspx?Login=LOGIN-HERE&EncryptedPassword=#{encrypted_password}&Import=Insert"
  body = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><Volusion_API><Products><HideProduct>#{hide_product}</HideProduct><ProductCode>#{product_code}</ProductCode><ProductName>#{product_name}</ProductName><ProductDescription>#{product_description}</ProductDescription><Availability>#{availability}</Availability><CustomField1>#{custom_field1}</CustomField1><CustomField2>#{custom_field2}</CustomField2><EnableOptions_InventoryControl>#{enable_options_inv_control}</EnableOptions_InventoryControl><FreeShippingItem>#{free_shipping_item}</FreeShippingItem><Height>#{height}</Height><Length>#{length}</Length><Width>#{width}</Width><METATAG_Description>#{metatag_description}</METATAG_Description><METATAG_Title>#{metatag_title}</METATAG_Title><Photo_AltText>#{photo_alt_text}</Photo_AltText><PhotoURL_Large>#{photo_url_large}</PhotoURL_Large><PhotoURL_Small>#{photo_url_small}</PhotoURL_Small><ProductCategory>#{product_category}</ProductCategory><ProductPrice>#{product_price}</ProductPrice><ProductWeight>#{product_weight}</ProductWeight><METATAG_Keywords>#{metatag_keywords}</METATAG_Keywords></Products></Volusion_API>"

  post(post_url, body: body)
end

我找不到任何文档,其中给出了该项目中包含多张照片的示例。我试过复制电话。例子:<PhotoURL_Large>img1</PhotoURL_Large><PhotoURL_Small>img1</PhotoURL_Small><PhotoURL_Large>img2</PhotoURL_Large><PhotoURL_Small>img2</PhotoURL_Small>

这导致没有图像上传。

我意识到 PhotoURL 与项目照片的 url 无关,而仅与 Volusion 的添加项目表单中的数据相关。

有人可以为我指出正确的方向来访问 volusion 项目的真实照片网址吗?

4

1 回答 1

0

In Volusion, PhotoURL_Small and PhotoURL_Large are alternate image URLs that can either point to an internal or external location. Volusion only provides one of each for each product code which will be used by the product in place of any loaded image. So if you populate any of the above two fields for that product it will use that URL in place of any image uploaded via the image manager or any images directly uploaded via FTP. There is no provision in the software for additional PhotoURL_Small and PhotoURL_Large images.

Here is an excellent explanation of image file structure.

Image structure

于 2015-01-15T11:50:35.977 回答