Skip to content

Commit

Permalink
Merge pull request #548 from razorpay/magic_banner
Browse files Browse the repository at this point in the history
[PLUGIN1CC-3639] Added magic checkout admin banner on wooc dashboard
  • Loading branch information
ChetanGN authored Apr 25, 2024
2 parents 1968c9e + 5b0851e commit 76b0332
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions woo-razorpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ protected function initHooks()
{
add_action('woocommerce_receipt_' . $this->id, array($this, 'receipt_page'));

add_action('admin_notices', array($this, 'add_magic_banner'));

add_action('woocommerce_api_' . $this->id, array($this, 'check_razorpay_response'));

$cb = array($this, 'process_admin_options');
Expand All @@ -361,6 +363,13 @@ protected function initHooks()
add_filter( 'woocommerce_thankyou_order_received_text', array($this, 'getCustomOrdercreationMessage'), 20, 2 );
}

// Magic checkout admin banner has been added.
public function add_magic_banner()
{
echo '<div class="notice notice-info is-dismissible">
<a href="https://razorpay.com/magic/?utm_source=WooCommerce&utm_medium=banner" target="_blank"><img src="https://cdn.razorpay.com/static/assets/magic-checkout/platforms/wooc_banner.png" style="width: 100%;"/></a></div>';
}

public function init_form_fields()
{
$webhookUrl = esc_url(admin_url('admin-post.php')) . '?action=rzp_wc_webhook';
Expand Down

0 comments on commit 76b0332

Please sign in to comment.