wp-e-commerce / WP-e-Commerce

WP eCommerce - The most popular independent eCommerce platform for WordPress
https://wpecommerce.org
GNU General Public License v2.0
213 stars 216 forks source link

Investigate adding support for 3.0 gateways to 1.0 theme engine #1715

Open JustinSainton opened 9 years ago

JustinSainton commented 9 years ago

No promises here, but would be nice to have.

instinct commented 9 years ago

Hmmm what about just a message saying this gateway is not compatible with your current theme. Click here to read more.

That type of thing?

Sent from my iPhone

On 21/12/2014, at 4:03 am, Justin Sainton notifications@github.com wrote:

No promises here, but would be nice to have.

— Reply to this email directly or view it on GitHub.

JustinSainton commented 9 years ago

Yeah, that's the kind of thing I'd like to avoid as a result of this investigation.

instinct commented 9 years ago

Oh so are you saying wait and don't surface anything at all until everything is fully compatible... Yup that'd mitigate any user experience work.

Sent from my iPhone

On 21/12/2014, at 8:21 am, Justin Sainton notifications@github.com wrote:

Yeah, that's the kind of thing I'd like to avoid as a result of this investigation.

— Reply to this email directly or view it on GitHub.

omarabid commented 9 years ago

Why not disable them if Theme Engine 2.0 is not active for the moment?

JustinSainton commented 9 years ago

Because that's the opposite of the point of this ticket.

JustinSainton commented 9 years ago

Findings:

  1. Express Checkout worked fine out of the box. Neat.
  2. wpsc_is_checkout() never worked for the 1.0 engine, so the assets were never enqueued at all.
  3. Once they were enqueued, Hosted Pro needed some massaging. Namely, for some reason (which I never could quite sort out), it wouldn't submit the hidden form to the iframe via the submit() method. Had to actually click() the image. Found some 5-year old jQuery bugs that had to do with images with a name of submit and that being buggy for submit handlers - but it worked fine on the new theme engine. Bizarro.
  4. Other massaging of the JS included targeting selectors from both theme engines.
  5. Also had to append the custom_gateway value to the serialized form. jQuery.serialize() only recognizes filled in values, and since we have it as custom_gateway, not custom_gateway[], it only recognizes the first element. ergo, if we have multiple elements and it's not the first one that is checked, serialize() doesn't capture it.

Once I went through all those steps, both theme engines seemed to function just fine with the new gateways. Big win. Lots of testing, please :) Will do a similar pass on DG.

JustinSainton commented 9 years ago

Digital Goods is now supported in the old theme engine.

Oddly enough, I kept hitting errors because I didn't fill in shipping info, and PayPal returned errors, saying that shipping info was required...for digital goods.

@omarabid, let's look into this, that's an odd requirement.

JustinSainton commented 9 years ago

Assigning to @omarabid for the remaining Digital Goods issues:

  1. Ensure shipping is not required or validated on Digital Goods
  2. Ensure that upon failure, Digital Goods iframe still returns proper results,rather than broken home page.
omarabid commented 9 years ago
  1. Fixed
  2. This only happens if it is a Fatal Error as it breaks PHP. Gary's made it so that if there is a missing "required" parameter, then the application will break. In DG it's less visible because it's loading another frame.
omarabid commented 9 years ago

@JustinSainton I'm thinking to check for the AJAX response. If it's not a valid URL then show a alert popup. What do you think?

JustinSainton commented 9 years ago

That works for me.

When you say the first issue is fixed - where can I see that fix? I haven't seen a PR come in. Also, are you able to fix the second issue?

omarabid commented 9 years ago

@JustinSainton This should be fixed, right?

JustinSainton commented 9 years ago

I'll have @edoriv and @misulicus test to confirm.