coinbase / coinbase-commerce-woocommerce

Accept Bitcoin on your WooCommerce-powered website.
https://commerce.coinbase.com/integrate/woocommerce
Apache License 2.0
58 stars 41 forks source link

Order Received page issue #10

Closed topraf closed 5 years ago

topraf commented 5 years ago

The order received page shows Coinbase data even when payment through stripe . see here in this test order i made image

Nikoogle commented 5 years ago

This can be fixed by modifying the function that actually generates the code to run a check.

Function is located on line 123 in coinbase-commerce.php

It is called cb_order_meta_general.

It can be modified to actually check if the order was paid with crypto.


/**
 * 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 ){ ?>

    <?php $is_paid_crypto = $order->get_meta( '_coinbase_charge_id' ); ?>

    <?php if ($is_paid_crypto) : ?>

    <br class="clear" />
    <h3>Coinbase Commerce Data</h3>
    <div class="">
        <p>Coinbase Commerce Reference # <?php echo esc_html($is_paid_crypto); ?></p>
    </div>

    <?php endif; ?>
    <?php
}
topraf commented 5 years ago

Pasting that in my functions.php file creates a 500 error. Are you sure about the code? Hope to see as an option in the plugin soon!

Nikoogle commented 5 years ago

Hey @topraf , you should not paste it in your funcitons.php. Instead, you can modify as mentioned in my comment above: "Function is located on line 123 in coinbase-commerce.php"

I am using it in a production environment with no issues.

topraf commented 5 years ago

Ah yeah ok; thanks! I'll keep the issue open so it can be implemented in the next version of the plugin

Nikoogle commented 5 years ago

I honestly doubt it, those guys are not showing good levels of support thus far. I would advise you to dig in and do it yourself.

guacamoli commented 5 years ago

@topraf, this is fixed in the latest code, please stay tuned for the newest release.