0

以下のコードを使用して製品を $products SimpleXML オブジェクトに追加しようとすると、「警告: ファイル内のオフセット タイプが不正で、何が問題なのかわかりません」というエラーが表示されます。

          $fields = array(
            $o->order_id => 'order_id',
            $o->order_address_id => 'order_address_id',
            $o->price_ex_tax => 'price_ex_tax' ,
            'DISCS' => 'sku',
             '1' => 'quantity'
        );                            

        $products->addChild('product');
        array_walk_recursive($fields, array ($products, 'addChild'));

$products に print_r を使用した私の SIMPLEXML オブジェクトは次のとおりです。

SimpleXMLElement Object
(
    [product] => Array
    (
        [0] => SimpleXMLElement Object
            (
                [id] => 23
                [order_id] => 110
                [product_id] => 63477
                [order_address_id] => 11
                [name] => Dead Sea Treasures Foot Cream
                [sku] => 703
                [type] => physical
                [base_price] => 20.0000
                [price_ex_tax] => 20.0000
                [price_inc_tax] => 20.0000
                [price_tax] => 0.0000
                [base_total] => 40.0000
                [total_ex_tax] => 40.0000
                [total_inc_tax] => 40.0000
                [total_tax] => 0.0000
                [weight] => 0.5
                [quantity] => 2
                [base_cost_price] => 0.0000
                [cost_price_inc_tax] => 0.0000
                [cost_price_ex_tax] => 0.0000
                [cost_price_tax] => 0.0000
                [is_refunded] => false
                [refund_amount] => 0.0000
                [return_id] => 0
                [wrapping_name] => SimpleXMLElement Object
                    (
                    )

                [base_wrapping_cost] => 0.0000
                [wrapping_cost_ex_tax] => 0.0000
                [wrapping_cost_inc_tax] => 0.0000
                [wrapping_cost_tax] => 0.0000
                [wrapping_message] => SimpleXMLElement Object
                    (
                    )

                [quantity_shipped] => 0
                [event_name] => NULL
                [event_date] => SimpleXMLElement Object
                    (
                    )

                [fixed_shipping_cost] => 0.0000
                [ebay_item_id] => SimpleXMLElement Object
                    (
                    )

                [ebay_transaction_id] => SimpleXMLElement Object
                    (
                    )

                [option_set_id] => NULL
                [parent_order_product_id] => NULL
                [is_bundled_product] => false
                [bin_picking_number] => SimpleXMLElement Object
                    (
                    )

                [applied_discounts] => SimpleXMLElement Object
                    (
                        [discount] => SimpleXMLElement Object
                            (
                                [id] => 1
                                [amount] => 4
                            )

                    )

                [product_options] => SimpleXMLElement Object
                    (
                    )

                [configurable_fields] => SimpleXMLElement Object
                    (
                    )

            )

        [1] => SimpleXMLElement Object
            (
                [id] => 24
                [order_id] => 110
                [product_id] => 63398
                [order_address_id] => 11
                [name] => Naot Matai
                [sku] => 11410-37-577
                [type] => physical
                [base_price] => 166.0000
                [price_ex_tax] => 166.0000
                [price_inc_tax] => 166.0000
                [price_tax] => 0.0000
                [base_total] => 166.0000
                [total_ex_tax] => 166.0000
                [total_inc_tax] => 166.0000
                [total_tax] => 0.0000
                [weight] => 2
                [quantity] => 1
                [base_cost_price] => 0.0000
                [cost_price_inc_tax] => 0.0000
                [cost_price_ex_tax] => 0.0000
                [cost_price_tax] => 0.0000
                [is_refunded] => false
                [refund_amount] => 0.0000
                [return_id] => 0
                [wrapping_name] => SimpleXMLElement Object
                    (
                    )

                [base_wrapping_cost] => 0.0000
                [wrapping_cost_ex_tax] => 0.0000
                [wrapping_cost_inc_tax] => 0.0000
                [wrapping_cost_tax] => 0.0000
                [wrapping_message] => SimpleXMLElement Object
                    (
                    )

                [quantity_shipped] => 0
                [event_name] => NULL
                [event_date] => SimpleXMLElement Object
                    (
                    )

                [fixed_shipping_cost] => 0.0000
                [ebay_item_id] => SimpleXMLElement Object
                    (
                    )

                [ebay_transaction_id] => SimpleXMLElement Object
                    (
                    )

                [option_set_id] => 32446
                [parent_order_product_id] => NULL
                [is_bundled_product] => false
                [bin_picking_number] => SimpleXMLElement Object
                    (
                    )

                [applied_discounts] => SimpleXMLElement Object
                    (
                    )

                [product_options] => SimpleXMLElement Object
                    (
                        [option] => Array
                            (
                                [0] => SimpleXMLElement Object
                                    (
                                        [id] => 57
                                        [option_id] => 49564
                                        [product_option_id] => 36782
                                        [display_name] => Womens Shoe Size
                                        [display_value] => 37 (US6)
                                        [value] => 277224
                                        [type] => SimpleXMLElement Object
                                            (
                                            )

                                        [name] => SimpleXMLElement Object
                                            (
                                            )

                                        [display_style] => SimpleXMLElement Object
                                            (
                                            )

                                    )

                                [1] => SimpleXMLElement Object
                                    (
                                        [id] => 58
                                        [option_id] => 49565
                                        [product_option_id] => 36783
                                        [display_name] => Shoe Color
                                        [display_value] => Copper/Wine Suede
                                        [value] => 277232
                                        [type] => SimpleXMLElement Object
                                            (
                                            )

                                        [name] => SimpleXMLElement Object
                                            (
                                            )

                                        [display_style] => SimpleXMLElement Object
                                            (
                                            )

                                    )

                            )

                    )

                [configurable_fields] => SimpleXMLElement Object
                    (
                    )

            )

    )
4

1 に答える 1