链接 Zmags 和 Google Checkout 时的 XML 元素
我正在尝试使用 Google checkout 来处理使用 Zmags 创建的购物车。
使用 Zmags,您可以将购物篮与电子商务购物车集成,但我想将其直接发送到 Google 结帐。
问题是 zmags 的 XML 输出与 Google checkout 所需的格式不同...
Zmag 创建的 XML 格式:
<shoppingList publicationID="abcdefgh">
<entries>
<entry quantity="7">
<item price="2.32" productID="AW3334-6445B">
<name>Skimmed Milk</name>
<description>Low fat milk.<description>
</item>
</entry>
<entry quantity="1">
<item price="1.25">
<name>Butter</name>
</item>
</entry>
</entries>
</shoppingList>
但是如果我直接将其发送给 Google,它不会获取值,因为元素和属性是命名不正确......
<item-id><item-id>
<item-name><item-name>
<item-description> <item-description>
etc...
任何人都可以推荐一种解决这个问题的方法,因为我似乎碰上了砖墙!
我试图读取变量 $quantity
、$description
等,然后以表单形式发布 ;
;但我认为我的语法还差得很远。
我还认为我可以做一些类似的事情: $item = $item-id;
但这似乎也不起作用!
I am attempting to use Google checkout to process a shopping cart created with Zmags.
With Zmags you can integrate a basket with your e commerce shopping cart, however I want to send it straight to Google checkout.
Problem is the XML output from zmags is not the same format as the one required by Google checkout...
The XML format Zmag creates:
<shoppingList publicationID="abcdefgh">
<entries>
<entry quantity="7">
<item price="2.32" productID="AW3334-6445B">
<name>Skimmed Milk</name>
<description>Low fat milk.<description>
</item>
</entry>
<entry quantity="1">
<item price="1.25">
<name>Butter</name>
</item>
</entry>
</entries>
</shoppingList>
But if I send this straight to Google it doesn't pick up the value's as the elements and attributes are not named correctly....
<item-id><item-id>
<item-name><item-name>
<item-description> <item-description>
etc...
Can anyone recommend a method for getting round this as I seem to have hit a brick wall!
I was attempting to read the variables$quantity
, $description
etc and then post in a form <input name="item_name_1" value="$_POST['$name']" >
; But I think my syntax is way off.
I also thought I could do something along the lines of: $item = $item-id;
but that doesn't seem to work either!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果不了解所需的 Google Checkout XML 架构,将一种 XML 架构转换为另一种 XML 架构的经典方法是使用 XSLT(XSL 转换)。请参阅
作为有关如何处理转换的任何示例,都需要一些有关所需 Google Checkout XML 架构的信息。
Without having knowledge of the required Google Checkout XML schema, the classic way to transform one XML schema into another is to use XSLT (XSL Transformations). Please see
as any example on how you can handle the transformation will require some information about the required Google Checkout XML schema.
这是正确的,您必须在您的网站中编写一个接收器页面来接收 Zmags 购物代码,然后使用 XHTML 将代码转换为 Google 兼容的 XML,在不知道 Google checkout 的情况下,我不确定这有多容易。
谢谢克里斯
This is correct you will have to program a receiver page in your site to receive the Zmags shopping code and then use XHTML to transform the code into Google compatible XML, without knowing Google checkout I am not sure how easy this would be.
Thanks
Chris
谷歌架构需要以下格式的信息:
是否可以使用以下内容重新分配密钥:
或者如果使用以下方式创建表单:
是否可以像简单的 php 表单一样为其设置名称。
例如
The google schema requires the information in the format:
is it possible to re assign the key with something along the lines of:
or if a form is created with:
could a name be set to it like in a simple php form.
eg