varunsridharan / woocommerce-quick-donation

Online Donation Using Woocoomerce. for woocommerce user's
https://wordpress.org/plugins/woocommerce-quick-donation
GNU General Public License v2.0
7 stars 11 forks source link

Donation form including user data directly sent to Woocommerce #14

Closed erralb closed 8 years ago

erralb commented 9 years ago

Hi,

This is a feature I would like to add to the plugin. I'm willing to develop it, and I thought you might be able to help / know if it's possible...

Basically I would like to have a donation form that contains not only the donation amounts (one shot donation or recurring donation), but also the user data (name, address, email, etc), and the payment gateway choices, so that once the form is filled, the person is directly redirected to the payment service, hence making the donation process faster.

Do you think it's possible to send all this data to Woocommerce at once and then redirect it?

I'm going to give it a shot and thought you might be interested :)

varunsridharan commented 9 years ago

Hi, Thanks for taking interest in this plugin :) i am exited. it can be done. can you develop the feature you requested and i will develop the base

erralb commented 9 years ago

Yeah sure, I will fork your plugin and make a pull request when I have something.

The thing I need to look into is how can I post all the data to WooCommerce at once...

erralb commented 9 years ago

Actually, I need to be able to override the donation template to achieve this... :) Do you think you will correct this issue today?

varunsridharan commented 9 years ago

You want extra field to save in order right ?

varunsridharan commented 9 years ago

its possible just a simple steps :+1: please don't fork this repo now. because it not updated with latest source :( can i know where are your from

erralb commented 9 years ago

I am from France! Me and my associate have a web agency and we work a lot with NGOs, that's why I'm interested in developing further your plugin.

Actually, could you update the Github repo with the latest version of the plugin? We work only with Git... it's the best way... If you want I can also update my fork with the latest version...

Basically, the form I must achieve will contain the following fields : One time amount and Recurring amount (to work with the WooCommerce subscription addon) User data (name, email, adress) Payment gateway option

On submit, with correct values, the WooComerce order and member account should be created and then the user directly redirected to the payment system without extra steps. After payment, the user should be redirected to a customized Thank You page.

See what I'm getting at? :)

varunsridharan commented 9 years ago

Ho thats nice. :)

till what time are you avaiable today. now i am at office will be back in 3 - 4 hrs max from now i am from india and my time zone is +5:30 GMT

erralb commented 9 years ago

I send you an email, so you have mine. Thanks for sending a quick fix for the template overriding issue!

varunsridharan commented 9 years ago

Hi, @ierpe do you have any update ?

erralb commented 9 years ago

Hi, I have done something, but I don't think it's a great solution, I'm still looking on how to improve this. Basically, in your process_donation function, I'm storing the $_POST data into the customer WC session like this :

//add form data into the WC session
$woocommerce->session->customer = array_merge($woocommerce->session->customer,$_POST);

Then in the donation-form-billing.php I am getting these values back and put them into the form :

    <?php foreach ( $checkout->checkout_fields['billing'] as $key => $field ) : ?>

        <?php 
        if(isset($woocommerce->session->customer[$key]))
            woocommerce_form_field( $key, $field, $woocommerce->session->customer[$key] );
        else
            woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
        ?>

    <?php endforeach; ?>

I created an "extended branch on my fork if you want to have a look. I guess they must be some WC hooks / filters which would allow to do something better than this, I'm still working on it...

https://github.com/Negative-Network/woocommerce-quick-donation/commit/dbbd2ebf121e932d35ae0ee2e220478c97e7882b

varunsridharan commented 9 years ago

@ierpe can we have a chat in next 3 hrs max ?

erralb commented 9 years ago

Hi Varun, hope you're good! :)

We are in a big rush atm, so I might not have a lot of time... But I connected on the campfire room, so come anytime and hit me up!

On 29 October 2015 at 12:43, Varun Sridharan notifications@github.com wrote:

@ierpe https://github.com/ierpe can we have a chat in next 3 hrs max ?

— Reply to this email directly or view it on GitHub https://github.com/technofreaky/woocomerce-quick-donation/issues/14#issuecomment-152155028 .

Pierre