Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Express Checkout - Icons for WC checkout page general list of gateways. #878

Closed
angelleye opened this issue Sep 21, 2017 · 12 comments
Closed
Assignees
Labels
Milestone

Comments

@angelleye
Copy link
Collaborator

In #251 we addressed an issue where the graphic on the checkout is not using https:// when it should. It looks like those commits were never merged into our core code, though.

Looking at what we do have in our code it seems we did try to address this:

    public function get_icon() {
        $image_path = plugins_url('/assets/images/paypal.png', plugin_basename(dirname(__FILE__)));
        if ($this->show_paypal_credit == 'yes') {
            $image_path = plugins_url('/assets/images/paypal-credit-card-logos.png', plugin_basename(dirname(__FILE__)));
        }
        if ($this->checkout_with_pp_button_type == 'customimage') {
            $image_path = $this->pp_button_type_my_custom;
        }
        if (is_ssl()) {
            $image_path = preg_replace("/^http:/i", "https:", $image_path);
        }
        $icon = "<img src=\"$image_path\" alt='" . __('Pay with PayPal', 'paypal-for-woocommerce') . "'/>";
        return apply_filters('woocommerce_paypal_express_icon', $icon, $this->id);
    }

I'm a little bit confused by this whole piece of logic. I'm not sure why we're using paypal.png at all anymore..?? Also, we have paypal-credit.png included in our /assets/images/ but it doesn't seem to be getting used at all in the logic. We are using paypal-credit-card-logos.png if show_paypal_credit is enabled, which is the better graphic, but it doesn't include anything about PayPal Credit.

So we have a few things to look at here.

  • Why would is_ssl() be coming up false for this guy when his site is indeed running on https://?
  • Why are we using a graphic within our PayPal Credit specific logic that doesn't actually PayPal Credit image?
  • Why do we still have paypal-credit.png included in our assets/images if we aren't using it at all?
  • Why are we still using the ugly paypal.png? I thought we got rid of that a while ago..??

Basically, I think what we need to do here is use the paypal-credit-card-logos.png as our default image instead of paypal.png. Then, we need to make another version of that which includes a PayPal Credit icon along with the others, and use that when show_paypal_credit is enabled. Finally, we need to double check our logic around http:// vs. https:// to ensure it's always properly output.

@kcppdevelopers
Copy link
Contributor

@angelleye we are using paypal.png since last 1.3.0 milestone, please confirm, are you really want to changed express checkout gateway default image to paypal-credit-card-logos.png ?

@kcppdevelopers
Copy link
Contributor

@angelleye it seems paypal-credit-card-logos.png image is not suitable for PayPal Express checkout payment method.

@angelleye
Copy link
Collaborator Author

@kcppdevelopers Yeah, you're right. It would make sense if Guest Checkout is enabled to show that you can pay with PayPal or credit cards, but if it's just PayPal then it wouldn't be good to show them all.

I do want to improve that graphic. It just doesn't look good because it's not centered nicely. Can we replace it with this one? You may need to resize it so it fits well.

paypal-logo

@kcppdevelopers
Copy link
Contributor

untitled

@angelleye
Copy link
Collaborator Author

@kcppdevelopers How come the PayPal Pro option here doesn't have any graphic/icons next to it?

@kcppdevelopers
Copy link
Contributor

878

it's working well, I was have set wrong path in gateway setting panel.

@angelleye
Copy link
Collaborator Author

@kcppdevelopers Please show me again what shows up here for PayPal Express when PayPal Credit is enabled as well?

angelleye pushed a commit that referenced this issue Sep 26, 2017
@angelleye
Copy link
Collaborator Author

@kcppdevelopers I checked it out, and when PayPal Credit enabled in settings I'm getting this on the WC checkout page:

image

So it's still not showing me a graphic that includes PayPal Credit..??

@angelleye
Copy link
Collaborator Author

@kcppdevelopers Yeah, seems our logic here still isn't right. When I disable PayPal Credit I end up with this:

image

However, I do have Guest Checkout enabled, so really the image above is what should show up in this case.

@angelleye
Copy link
Collaborator Author

angelleye commented Sep 26, 2017

@kcppdevelopers So to reiterate...

  1. If Express Checkout is enabled, but both PayPal Credit and our option to "Allow customers to checkout without a PayPal account using their credit card" are disabled, then we should see the PayPal only graphic.

image

  1. If Express checkout is enabled, PayPal Credit is disabled, but "Allow customers to checkout without a PayPal account using their credit card" is enabled, then we should see the PayPal + CC icons graphic:

image

  1. If Express is enabled, PayPal Credit is enabled, and "Allow customers to checkout without PayPal..." is enabled, then we should see the PayPal + CC icons graphic, but it needs to also include an icon for PayPal Credit. I thought I saw you had a graphic like this created already, but I don't see it now..??

@kcppdevelopers
Copy link
Contributor

@angelleye I think one more condition we miss here.

  1. If Express is enabled, PayPal Credit is enabled, and "Allow customers to checkout without PayPal..." is disabled, then we should see the PayPal +PayPal Credit icon. right?
    screenshot-2017-9-26 checkout dev

@angelleye
Copy link
Collaborator Author

angelleye commented Sep 26, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant