gpt4 book ai didi

使用自定义 php 代码的 drupal 条件操作

转载 作者:行者123 更新时间:2023-12-03 16:56:35 24 4
gpt4 key购买 nike

在为条件操作添加自定义 php 代码时,drupal/ubercart 提供了两个 php 变量($order 和 $account),用于保存有关订单的信息和刚刚完成的结帐帐户。

我在 Internet 上的任何地方都找不到关于这些对象的结构的文档...有人知道这个文档在哪里或者这些对象是如何设置的吗???

谢谢

最佳答案

这是 $order 对象在相当标准的安装中的样子(根据您的安装可能会有所不同。当然,订单中的产品决定了项目部分的样子:

stdClass Object
(
[order_id] => 123
[uid] => 456
[order_status] => payment_received
[order_total] => 100
[product_count] => 1
[primary_email] => test@example.com
[delivery_first_name] => Test
[delivery_last_name] => Customer
[delivery_phone] => 123-123-1234
[delivery_company] => ABC Company, Inc.
[delivery_street1] => 123 Easy St.
[delivery_street2] =>
[delivery_city] => Anytown
[delivery_zone] => 39
[delivery_postal_code] => 12345
[delivery_country] => 840
[billing_first_name] => Test
[billing_last_name] => Customer
[billing_phone] => 123-123-1234
[billing_company] => ABC Company, Inc.
[billing_street1] => 123 Easy St.
[billing_street2] =>
[billing_city] => Anytown
[billing_zone] => 39
[billing_postal_code] => 12345
[billing_country] => 840
[payment_method] => credit
[data] => Array
(
[cc_data] => ***encrypted credit card data***
)

[created] => 1295455508
[modified] => 1295457962
[host] => 127.0.0.1
[products] => Array
(
[0] => stdClass Object
(
[order_product_id] => 245
[order_id] => 123
[nid] => 5
[title] => Test Product
[manufacturer] =>
[model] => TEST-PRODUCT-SKU
[qty] => 1
[cost] => 100.00000
[price] => 100.00000
[weight] => 0
[data] => Array
(
[attributes] => Array
(
)

[shippable] => 1
[module] => uc_product
)

[order_uid] => 456
)

)

[payment_details] =>
[quote] => Array
(
[method] => flatrate_1
[accessorials] => 0
[rate] => 7.00000
[quote_form] =>
)

[line_items] => Array
(
[0] => Array
(
[line_item_id] => subtotal
[type] => subtotal
[title] => Subtotal
[amount] => 100
[weight] => 0
[data] =>
)

[1] => Array
(
[line_item_id] => 194
[type] => shipping
[title] => Flat Rate Shipping
[amount] => 7.00000
[weight] => 1
[data] =>
)

)

)

关于使用自定义 php 代码的 drupal 条件操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4521745/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com