Checkout Daten als JSON
-
Hallo Forengemeinde,
ich versuche gerade die Daten aus dem Checkout (am Beispiel des Paypal Gateways) als JSON zu bekommen aber sobald ich den Array in ein json_encode() packe kommt an der Ziel URL nichts an.
Hier (exemplarisch) Auszug aus dem class-wc-gateway-paypal-request.php (ab Zeile 64):
return apply_filters( 'woocommerce_paypal_args', array_merge( array( 'cmd' => '_cart', 'business' => $this->gateway->get_option( 'email' ), 'no_note' => 1, 'currency_code' => get_woocommerce_currency(), 'charset' => 'utf-8', 'rm' => is_ssl() ? 2 : 1, 'upload' => 1, 'return' => esc_url( add_query_arg( 'utm_nooverride', '1', $this->gateway->get_return_url( $order ) ) ), 'cancel_return' => esc_url( $order->get_cancel_order_url() ), 'page_style' => $this->gateway->get_option( 'page_style' ), 'paymentaction' => $this->gateway->get_option( 'paymentaction' ), 'bn' => 'WooThemes_Cart', 'invoice' => $this->gateway->get_option( 'invoice_prefix' ) . $order->get_order_number(), 'custom' => json_encode( array( 'order_id' => $order->id, 'order_key' => $order->order_key ) ), 'notify_url' => $this->notify_url, 'first_name' => $order->billing_first_name, 'last_name' => $order->billing_last_name, 'company' => $order->billing_company, 'address1' => $order->billing_address_1, 'address2' => $order->billing_address_2, 'city' => $order->billing_city, 'state' => $this->get_paypal_state( $order->billing_country, $order->billing_state ), 'zip' => $order->billing_postcode, 'country' => $order->billing_country, 'email' => $order->billing_email ), $this->get_phone_number_args( $order ), $this->get_shipping_args( $order ), $this->get_line_item_args( $order ) ), $order );
Will ich dann ersetzen durch etwa so (nur mehr Felder am Ende):
return apply_filters( 'woocommerce_paypal_args',json_encode( array( 'feld1' => $feld1, 'feld2' => $feld2 )))
Nun ja, bislang kommt da am Ende nichts an. Was ist falsch?
Ansicht von 3 Antworten - 1 bis 3 (von insgesamt 3)
Ansicht von 3 Antworten - 1 bis 3 (von insgesamt 3)
- Das Thema „Checkout Daten als JSON“ ist für neue Antworten geschlossen.