Closed ciscospirit closed 5 years ago
I found out that there is a PHP notice problem:
To fix this I checked into the coinbase-commerce.php and found there 2 references to "payment_method".
/** * Add order Coinbase meta after General and before Billing * * @see: https://rudrastyh.com/woocommerce/customize-order-details.html * * @param WC_Order $order WC order instance */ function cb_order_meta_general( $order ) { if ($order->payment_method == 'coinbase') { ?> <br class="clear"/> <h3>Coinbase Commerce Data</h3> <div class=""> <p>Coinbase Commerce Reference # <?php echo esc_html($order->get_meta('_coinbase_charge_id')); ?></p> </div> <?php } } /** * Add Coinbase meta to WC emails * * @see https://docs.woocommerce.com/document/add-a-custom-field-in-an-order-to-the-emails/ * * @param array $fields indexed list of existing additional fields. * @param bool $sent_to_admin If should sent to admin. * @param WC_Order $order WC order instance * */ function cb_custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) { if ($order->payment_method == 'coinbase') { $fields['coinbase_commerce_reference'] = array( 'label' => __( 'Coinbase Commerce Reference #' ), 'value' => $order->get_meta( '_coinbase_charge_id' ), ); } return $fields; }
there i changed:
this: if ($order->payment_method == 'coinbase') { to: if ($order->get_payment_method() == 'coinbase') {
if ($order->payment_method == 'coinbase') {
if ($order->get_payment_method() == 'coinbase') {
and
this:
function cb_custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) { if ($order->payment_method == 'coinbase') {
to:
function cb_custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) { if ($order->get_payment_method() == 'coinbase') {
This will fix the PHP notice problem.
I have created a PR for this.
I found out that there is a PHP notice problem:
To fix this I checked into the coinbase-commerce.php and found there 2 references to "payment_method".
there i changed:
this:
if ($order->payment_method == 'coinbase') {
to:if ($order->get_payment_method() == 'coinbase') {
and
this:
to:
This will fix the PHP notice problem.