Skip to content

Commit

Permalink
PayPal Advanced - Logo Recommendation, ref #491
Browse files Browse the repository at this point in the history
  • Loading branch information
kcppdevelopers committed Aug 17, 2016
1 parent 35065fc commit a2c5098
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions assets/js/angelleye-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ jQuery(document).ready(function ($) {
//PayPal Flow
jQuery("#woocommerce_paypal_pro_payflow_card_icon").css({float: "left"});
jQuery("#woocommerce_paypal_pro_payflow_card_icon").after('<a href="#" id="upload" class="button_upload button">Upload</a>');

jQuery("#woocommerce_paypal_advanced_card_icon").css({float: "left"});
jQuery("#woocommerce_paypal_advanced_card_icon").after('<a href="#" id="upload" class="button_upload button">Upload</a>');

var custom_uploader;
$('.button_upload').click(function (e) {
Expand Down
13 changes: 12 additions & 1 deletion classes/wc-gateway-paypal-advanced-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class WC_Gateway_PayPal_Advanced_AngellEYE extends WC_Payment_Gateway {

public function __construct() {
$this->id = 'paypal_advanced';
$this->icon = apply_filters('woocommerce_paypal_advanced_icon', plugins_url('/assets/images/cards.png', plugin_basename(dirname(__FILE__))));

$this->has_fields = true;
$this->home_url = is_ssl() ? home_url('/', 'https') : home_url('/'); //set the urls (cancel or return) based on SSL
$this->testurl = 'https://pilot-payflowpro.paypal.com';
Expand Down Expand Up @@ -40,6 +40,12 @@ public function __construct() {
$this->page_button_bgcolor = $this->settings['page_button_bgcolor'];
$this->page_button_textcolor = $this->settings['page_button_textcolor'];
$this->label_textcolor = $this->settings['label_textcolor'];

$this->icon = !empty($this->settings['card_icon']) ? $this->settings['card_icon'] : WP_PLUGIN_URL . "/" . plugin_basename(dirname(dirname(__FILE__))) . '/assets/images/cards.png';
if (is_ssl()) {
$this->icon = preg_replace("/^http:/i", "https:", $this->settings['card_icon']);
}
$this->icon = apply_filters('woocommerce_paypal_advanced_icon', $this->icon);

if (!isset($this->settings['mobilemode']))
$this->mobilemode = 'yes';
Expand Down Expand Up @@ -730,6 +736,11 @@ public function init_form_fields() {
'default' => 'yes',
'description' => sprintf(__('Disable this option if your theme is not compatible with Mobile. Otherwise You would get Silent Post Error in Layout C.', 'paypal-for-woocommerce'), 'https://developer.paypal.com/'),
),
'card_icon' => array(
'title' => __('Card Icon', 'paypal-for-woocommerce'),
'type' => 'text',
'default' => WP_PLUGIN_URL . "/" . plugin_basename(dirname(dirname(__FILE__))) . '/assets/images/cards.png'
),
'invoice_prefix' => array(
'title' => __('Invoice Prefix', 'paypal-for-woocommerce'),
'type' => 'text',
Expand Down

0 comments on commit a2c5098

Please sign in to comment.