Using PayPal Smart Buttons in WYSIWYG Content Editor

If you are choosing to use a PayPal Smart Button in the WYWIWYG content editor, you will need to make a couple modifications to the code PayPal provides you. This will allow the code to be compatible with the functionality of our content editor.

Modification 1

 
You will need to add a “data-price” attribute to each of the dropdown item option selections for price.
Example:
data-price="40.00">Summer 2021 Fee - 40.00 USD data-price="60.00">Fall/Spring 2021-2022 Fee - 60.00 USD data-price="25.00">Afterschool Fee - 25.00 USD data-price="100.00">Summer and Fall Fees - 100.00 USD data-price="85.00">Fall and Aftercare Fees - 85.00 USD data-price="125.00">Summer, Fall and Aftercare Fees - 125.00 USD You can do so in the source code (<>) area of the content editor. Modification 2 You will need to adjust the selectedItemPrice variable that PayPal’s code provides. Example: PayPal Code: var selectedItemPrice = parseFloat(itemOptions.options[itemOptions.selectedIndex].getAttribute("price"));   Needs to be updated to:  var selectedItemPrice = parseFloat(itemOptions.options[itemOptions.selectedIndex].dataset.price);

Updated

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.