Skip to content

Commit

Permalink
Allow merchants to disable the BitPay logo in the mini cart
Browse files Browse the repository at this point in the history
  • Loading branch information
thejoshualewis committed Dec 31, 2019
1 parent 6afbda3 commit f1e8fc0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
24 changes: 22 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: BitPay Checkout for WooCommerce
* Plugin URI: https://www.bitpay.com
* Description: Create Invoices and process through BitPay. Configure in your <a href ="admin.php?page=wc-settings&tab=checkout&section=bitpay_checkout_gateway">WooCommerce->Payments plugin</a>.
* Version: 3.12.1912
* Version: 3.14.1912
* Author: BitPay
* Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce
*/
Expand Down Expand Up @@ -326,6 +326,18 @@ public function init_form_fields()
'default' => '2',
),

'bitpay_checkout_mini' => array(
'title' => __('Show in mini cart ', 'woocommerce'),
'type' => 'select',
'description' => __('Set to YES if you would like to show BitPay as an immediate checkout option in the mini cart', 'woocommerce'),
'options' => array(
'1' => 'Yes',
'2' => 'No',
),
'default' => '2',
),


'bitpay_checkout_show_logo' => array(
'title' => __('Show logo on Checkout ', 'woocommerce'),
'type' => 'select',
Expand Down Expand Up @@ -520,7 +532,9 @@ function bpCheckout(){

//show on the mini cart
function bitpay_mini_checkout() {

$bitpay_checkout_options = get_option('woocommerce_bitpay_checkout_gateway_settings');
$bitpay_checkout_mini = $bitpay_checkout_options['bitpay_checkout_mini'];
if($bitpay_checkout_mini == 1):
$url = get_permalink( get_option( 'woocommerce_checkout_page_id' ) );
$url.='?payment=bitpay';

Expand All @@ -542,6 +556,7 @@ function bpMiniCheckout(){

</script>
<?php
endif;
}

add_action( 'woocommerce_widget_shopping_cart_buttons', 'bitpay_mini_checkout', 20 );
Expand Down Expand Up @@ -1059,6 +1074,11 @@ function bitpay_checkout_custom_message($order_id)
endif;
}


add_action('wp_footer', 'bitpay_chrome_extension');
function bitpay_chrome_extension() {
echo '<div id = "bpDiv123119" style = "clear:both;"></div>';
}
#bitpay image on payment page
function BPC_getBitPaymentIcon()
{
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: bitcoin, bitcoin cash, payments, bitpay, cryptocurrency, payment gateway
Requires at least: 4.9
Tested up to: 5.3
Requires PHP: 5.5
Stable tag: 3.12.1912
Stable tag: 3.14.1912
License: MIT License (MIT)
License URI: https://github.com/bitpay/bitpay-checkout-for-woocommerce/blob/master/LICENSE

Expand Down Expand Up @@ -114,6 +114,12 @@ You can contact our support team via the following form https://bitpay.com/reque

== Changelog ==

= 3.14.1912 =
* Allow merchants to disable the BitPay logo in the mini cart

= 3.13.1912 =
* Added support for future release of BitPay Chrome extension

= 3.12.1912 =
* Fixed issue where cart might not be restored after canceling the payment invoice

Expand Down

0 comments on commit f1e8fc0

Please sign in to comment.