latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

PayPal Pro Form Dynamic price

Home Forums Community Forum PayPal Pro Form Dynamic price

This topic contains 3 replies, has 2 voices. Last updated by  Bruce 3 years, 8 months ago.

Topic Author Topic
Posted: Tuesday Apr 16th, 2013 at 6:26 am #47600

Hi,

I’ve been trying to find a solution for my problem in the forum but couldn’t find it.

I’m using the shortcode to create a PayPal Pro Form with a certain price but I need to be able to change the price in certain situations.

I’m picking up a shipment price from another server and I need to add that to the price of the PayPal form, is it possible to do that via javascript before the submission?

Thank you

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Tuesday Apr 16th, 2013 at 11:37 pm #47635
Bruce
Username: Bruce
Staff Member

I’m picking up a shipment price from another server and I need to add that to the price of the PayPal form, is it possible to do that via javascript before the submission?

You’ll need to regenerate the Pro Form through the Shortcode, you can’t change the Pro Form’s price with JavaScript. For changing the price via PHP in your page, you can use the information provided in this Knowledge Base article:

Knowledge Base » Using Variables In A Shortcode

Posted: Thursday Apr 18th, 2013 at 10:35 am #47786

Is it possible to regenerate the Pro Form via ajax ?

I can’t really refresh the page since the form comes at the end of previous steps.

I’ve manage to load it with admin-ajax.php and then load the js paypal-min.js to make the form work again but after the submission I’m redirected here admin-ajax.php with 0 as result.

Help please I’m really stucked.

Posted: Thursday Apr 18th, 2013 at 11:41 pm #47848
Bruce
Username: Bruce
Staff Member

I can’t really refresh the page since the form comes at the end of previous steps.

I’ve manage to load it with admin-ajax.php and then load the js paypal-min.js to make the form work again but after the submission I’m redirected here admin-ajax.php with 0 as result.

The problem here is that s2Member needs to send the information via POST in the form, and recreate the form with the new price. If you really need this functionality I’d recommend using iFrames. You can submit a form within an iFrame without it refreshing your main page without needing any fancy AJAX. However that leaves the question of how you move the User to PayPal if they select it as their method of payment. If you’re using Authorize.Net you could (maybe) get away with this.

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.