1

ExpressionEngine newbie here. Please bear with me.

A client recently asked me to help them update the PayPal code on their ExpressionEngine powered website because their usual PHP developer went MIA. They're aware I'm not an ExpressionEngine expert, but still asked me to take a look.

The client has an event page where they change the event periodically via an entry in ExpressionEngine. The entry controls the cost of the event and can be changed by an admin. This cost of the event is made in a variable called {events_cost}. The variable is translated to Paypal via a Paypal buy now button integration. What I'm trying to do is change how the {events_cost} dynamic variable is parsed by ExpressEngine so that instead of outputting as "$30" for example, it will output without the dollar sign and be just "30." The actual cost amount is controlled via a post entry under Content > Edit > Events. (I'm in need of taking out the dollar sign in order to make sure the code conforms with Paypal's new integration standards, as they don't allow currency signs in the code anymore.)

I've been trying to look for where the {events_cost} value is stored or translated, so that I can remove the dollar sign from the output. I'm sure this a newbie question with an obvious answer, but are there any thoughts as to where I can find where this value is being stored by the system to remove the dollar sign?

Their site currently runs on EE v2.10.1.

Thank you!

1

Instead of post-processing the $ out of the content editor's input, I would have the content editor change to not input the $. Then the variable can be used directly in the PayPal code without modification. Anywhere on the front end that needs to have the $ displayed can be placed with it in the template source with that variable, e.g.:

${events_cost}

If for some reason that ideal solution is not acceptable, you could use a plugin like Low Replace to remove the $ from the output.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.