链接 Zmags 和 Google Checkout 时的 XML 元素

发布于 2024-08-05 23:01:44 字数 1168 浏览 2 评论 0原文

我正在尝试使用 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 技术交流群。

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

发布评论

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

评论(3

煮茶煮酒煮时光 2024-08-12 23:01:44

如果不了解所需的 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.

七度光 2024-08-12 23:01:44

这是正确的,您必须在您的网站中编写一个接收器页面来接收 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

浅唱ヾ落雨殇 2024-08-12 23:01:44

谷歌架构需要以下格式的信息:

[item_quantity] => 1 
[item_ID] => 00001 
[item_price] => 4.99 
[item_name] => Full English 
[item_description] => Eggs, Beans, Sheesh Kebab Served with Toast ) 

是否可以使用以下内容重新分配密钥:

$entry->price = $item_price;

或者如果使用以下方式创建表单:

$output[] = '<td width="100">£'.$entry->price.'</td>';

是否可以像简单的 php 表单一样为其设置名称。

例如

name="item_price" value

The google schema requires the information in the format:

[item_quantity] => 1 
[item_ID] => 00001 
[item_price] => 4.99 
[item_name] => Full English 
[item_description] => Eggs, Beans, Sheesh Kebab Served with Toast ) 

is it possible to re assign the key with something along the lines of:

$entry->price = $item_price;

or if a form is created with:

$output[] = '<td width="100">£'.$entry->price.'</td>';

could a name be set to it like in a simple php form.

eg

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