creativelittledots / woocommerce-pay-later

A Payment Gateway for WooCommerce that allows Customers to Pay Later at Checkout.
18 stars 1 forks source link

Double e-commerce goals #1

Closed erikmolenaarnl closed 8 years ago

erikmolenaarnl commented 8 years ago

Hi! Just the plugin I was looking for. Awesome, thanks a million!

Just two issues:

A. When keeping track of goals/conversions, the checkout/order-received "thank you" page is hit twice:

  1. During checkout when "Pay Later" is choosen
  2. Again after payment when clicking the "Pay Now" link in the customer invoice e-mail

This way Google Analytics will record the conversion twice!

B. After clicking the "Pay Now" link in the customer invoice e-mail, the "Pay Later" option is still there, so the customer can always pay later in an infinite loop ;-) It should only be an available payment method during the initial checkout, not during invoice payment!

terence1990 commented 8 years ago

Hey there,

Thanks for using our work!

I can fix point B tomorrow in work hours, for Point A, generally speaking the Thank You page should be the resolving page after initial checkout and after actual payment.

Perhaps you can write a condition around your tracking code to pick up the status of the Order before outputting the tracking code? Unpaid Orders have the status 'pending' and paid orders have a status of 'processing' or ' complete' depending if an order needs processing such as shipping etc.

Hope that helps

Thanks,

erikmolenaarnl commented 8 years ago

Hi Terence,

Thanks for your reply!

A condition for the tracking code would be an option, but I use Enhanced E-commerce a lot which also gets in the way.

Generally speaking I think you should only show the order-received "thank you" only once and when successful payment has been completed (order status: "Processing"). After all, when selecting "Pay Later", the order is not yet completely finished (as "Pending Payment" is an earlier status). Would it be an option to include a custom 'order-received (but not yet thank you)' page during initial checkout? Here you can also add an additional description the customer has to check their e-mail, contact their bank to whitelist payment, click the "Pay Now" link and still to take some action (paying) before the order is really 'received' (and we can say 'thank you' for sure ;-)

terence1990 commented 8 years ago

Hey,

There could be away to unhook a certain action that is outputting the tracking code, you just need to find it in that plugin and remove the action and add it back based on the order status.

I think it is overkill adding a new wc_endpoint similar to order-received when this is a specific use case, however I can add a filter for a the redirect after the creation of the order using the PayLater gateway, that way you could redirect to a custom url / endpoint / thank you page of your own?

Thanks,

erikmolenaarnl commented 8 years ago

Hi Terence,

I think a redirect to a custom page after creation of an order (initial checkout) would be a very clean solution.

This way the order process of WooCommerce remains intact: showing the order-received once and only after payment is successfully received so the order can get the "Processing" status.

I think your plugin could benefit all WooCommerce sites, as it provides an easy 'save the sale' backup when a creditcard get declined or even when they don't have their (correct) creditcard within reach.

Looking forward to an update. Thanks!

p.s. Do you accept donations for your plugin? Do you have a bitcoin wallet address?

terence1990 commented 8 years ago

Hi,

By adding this filter you are able to add that custom page functionality yourself and just route to it after the Order is created, replacing the Thank You page process.

Thanks,

terence1990 commented 8 years ago

Hi Erik,

Version 1.0.1 has now been released, you head over to releases and download it.

I have added documentation too to this repo so you can see how to use the filter I have used.

Many thanks