PayPal calculate amount based on selection

  • TheMuffinMan
  • TheMuffinMan's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 7443
  • Karma: 144
  • Thank you received: 540

TheMuffinMan replied the topic: Re:PayPal calculate amount based on selection

Thats why I asked on what "action" you would like to fill the hidden input? On submit I guess?
If yes, then you could put that into the ff_validate_submit function (see "Scripts" library and that validation's details)



===============================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#10556
The following user(s) said Thank You: wartime
  • Posts: 78
  • Thank you received: 9

spencelk replied the topic: Re:PayPal calculate amount based on selection

When I enter this code into begin submit:
$this->execPieceByName('ff_InitLib');

function paypalSetAmountValue(){

if (ff_getElementByName('addVenue1').checked) {
  ff_getElementByName("PayPalSelect").value = 'productName|Two(2) Venues plus p&h|469.95|0';
  }
  
else  {
  ff_getElementByName("PayPalSelect").value = 'productName|One(1) Venue plus p&h|244.95|0';
  }
}

I get this error:
#10566
Attachments:
The following user(s) said Thank You: wartime
  • TheMuffinMan
  • TheMuffinMan's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 7443
  • Karma: 144
  • Thank you received: 540

TheMuffinMan replied the topic: Re:PayPal calculate amount based on selection

remove that first line that says

$this->execPieceByName('ff_InitLib');

It is for pieces, not scripts.



===============================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#10586
The following user(s) said Thank You: wartime
  • Posts: 78
  • Thank you received: 9

spencelk replied the topic: Re:PayPal calculate amount based on selection

I tried that still the same error. That is when I added that line hoping it would help. where should I be placing the code? right now it is under submit pieces>>begin submit.
#10596
The following user(s) said Thank You: wartime
  • TheMuffinMan
  • TheMuffinMan's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 7443
  • Karma: 144
  • Thank you received: 540

TheMuffinMan replied the topic: Re:PayPal calculate amount based on selection

thats wrong, it should go into Scripts "initialization script" since it is javascript. Pieces are php only.

Then you can use that in your custom validations etc.



===============================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#10597
The following user(s) said Thank You: wartime
  • Posts: 78
  • Thank you received: 9

spencelk replied the topic: Re:PayPal calculate amount based on selection

I'm not sure I fully understand. I put the js code in advanced options>scripts>initialization scripts but then also in custom validations?

I have tried putting it in both places as well as each separately. I am no longer getting an error it just doesn't do anything. I also tried placing it within the PayPalSelect intscript that did not work nor did the values of my summary fields display.

I appreciate all of your help with this. I hope we can get this working.
#10598
The following user(s) said Thank You: wartime
Moderators: ForumSupporttomeperica
Time to create page: 0.040 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Special Offer! Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for only 70!

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, WordPress® plugins, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here