Drupal conditional action with custom php code

When adding a custom php code for a conditional action, drupal / ubercart provides two php variables ($ order and $ account) that contain order and account information for the completed check.

I can not find anywhere in the online documentation about how these objects are structured ... does anyone know where this documentation is or how these objects are installed ???

thank

+3
source share
2 answers

Here's what the $ order object looks like on a fairly standard installation (maybe a little different depending on your installation. Of course, the products in the order determine what the item section looks like:

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] => 
                )

        )

)
+4
  • $account - .
  • $order - ubercart.

, - . , Drupal , ubercart .

- , , , .

devel dsm() t dd(). .

+2

Source: https://habr.com/ru/post/1781893/


All Articles