Dependencies

  • WebWizardWorkshop
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 49
  • Thank you received: 0

WebWizardWorkshop replied the topic: Dependencies

Your formula worked perfectly. The brackets make since as this is what is used for the same purpose in Excel spreadsheets and workbooks. I just didn't realize that I needed to add them and then the change to the hair type would eliminate one or the other from the results based on changes made by the user. That's awesome. Thanks. I'm still having the paypal load issue thou...any advise on that. It will not load when clicking to pay now. I just get a growing white space. Here are my settings:

Paypal Amount: <? php return value=(bfField('total')); ?>
Business email entered
Token entered
Test email entered
Test token entered
#233139
  • WebWizardWorkshop
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 49
  • Thank you received: 0

WebWizardWorkshop replied the topic: Dependencies

Oh and we took off for the holidays too. No worries. Thanks for following up with me afterwards.
#233140
  • Posts: 2365
  • Karma: 85
  • Thank you received: 317

mihaela replied the topic: Dependencies

Hello again,

I'm glad I've helped and that putting the brackets resolved the issue.

There are two ways the PayPal amount can be defined. If the price is fixed then you can set the PayPal button as explained here crosstec.org/en/support/online-documenta...8-paypal-button.html .

If the amount to be payed is not predefined, as it is the case with your form, you have to follow instructions from this piece of documentation crosstec.org/en/support/online-documenta...l-donation-form.html to collect the amount from form field.

let me know whether you've managed to do so.

Regards,

Mihaela
#233152
  • WebWizardWorkshop
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 49
  • Thank you received: 0

WebWizardWorkshop replied the topic: Dependencies

Well the first option indicates that a fixed amount is required; which can't be because the amount depends on the users form selections so it will not be the same for every user. So I can't just put in a fixed amount, which is why I attempted to have the paypal button to call the amount from the total field using this formula:

<? php return value=(bfField('total')); ?>

The second option was to let the custom enter the amount during the payment process. This wont work because someone could order $150 worth of hair and erroneously enter only $15.

I also should have mentioned that I have on the Advanced Tab > Actionscript > Click > ff_validate_submit. Could that be it?
#233187
  • WebWizardWorkshop
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 49
  • Thank you received: 0

WebWizardWorkshop replied the topic: Dependencies

The 'total' formula worked until I added two other select list elements; 'closure' and 'frontal', both of which impacts the total amount due. I updated to formula to read:

function ff_total_action(element,action)
{
ff_getElementByName('total').value =((
Number(ff_getElementByName('length').value) +
Number(ff_getElementByName('length2').value)) *
Number(ff_getElementByName('quantity').value) +
Number(ff_getElementByName('closure').value)+
Number(ff_getElementByName('frontal').value);
}
// ff_total_action




When that didn't work i added another set brackets to surround the length, length2, and quantity elements so that only those items are purchased in multiples and the closure and frontal are not. That way the form processes the lengths first, then adds the frontal cost and the closure cost. But that didn't work.

function ff_total_action(element,action)
{
ff_getElementByName('total').value =(((
Number(ff_getElementByName('length').value) +
Number(ff_getElementByName('length2').value)) *
Number(ff_getElementByName('quantity').value)) +
Number(ff_getElementByName('closure').value)+
Number(ff_getElementByName('frontal').value);
}
// ff_total_action




Well, that didn't work either. Next I tried this one for kicks and giggles, but it didn't work either.

function ff_total_action(element,action)
{
ff_getElementByName('total').value =((
Number(ff_getElementByName('length').value) +
Number(ff_getElementByName('length2').value)+
Number(ff_getElementByName('frontal').value)+
Number(ff_getElementByName('closure').value)) *
Number(ff_getElementByName('quantity').value)
}
// ff_total_action



in the frontal and closure Advance > Actionscrip > Change > I've included this code with this last attemp:

function ff_frontal_action(element, action)
{
ff_getElementByName('total').value =
Number(ff_getElementByName('frontal').value) *
Number(ff_getElementByName('quantity').value);
}
// ff_frontal_action



updating frontal/closure where necessary in the formula. Now, I can't get the total to show up on the form at all as I complete the form.
#233192
  • Posts: 2365
  • Karma: 85
  • Thank you received: 317

mihaela replied the topic: Dependencies

Hello again,

Regarding the PayPal button, you should follow the instructions from here crosstec.org/en/support/online-documenta...l-donation-form.html to achieve what you want.

You wrote "The second option was to let the custom enter the amount during the payment process. This wont work because someone could order $150 worth of hair and erroneously enter only $15.". User doesn't have to be the one who defines the amount in the textfield.
Instead of creating a new donationAmount field, you should use the existing "total" field which is read-only so user can't change it's value, but you can still use it as amount for PayPal.

The only important thing is that in the code described on the link you replace 'donationAmount' with 'total' so that the whole code looks like this:
function ff_PayPalButton_action(element, action) 
{ 
     switch (action)
     { 
          case 'click': 
          ff_getElementByName('bfPaymentSelect').value = 'Donation|0|' + ff_getElementByName('total').value + '|0'; 
          ff_validate_submit(); 
          break; 
          default:; 
     } // switch 
} // ff_PayPalButton_action 

"ff_validate_submit" has to be the part of the Actionscript on PayPal button so that is not a error.

Regarding the "frontal" and "closure", how did you define that two select lists? it might be that their values aren't defined correctly.

The following code that you've added should work, but you should add it to Actionscript of each element that is used in the calculation.
function ff_total_action(element,action)
{
ff_getElementByName('total').value =((
Number(ff_getElementByName('length').value) +
Number(ff_getElementByName('length2').value)) *
Number(ff_getElementByName('quantity').value) +
Number(ff_getElementByName('closure').value)+
Number(ff_getElementByName('frontal').value);
}
// ff_total_action

Regards,

Mihaela
#233209
Moderators: ForumSupporttomeperica
Time to create page: 0.063 seconds

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans & templates!

Get Your Subscription Here

News and Updates

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

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, 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!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

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