Jump to content

Simple One-Line Code Replacement Plugin?


kpmedia

Recommended Posts

In

\components\gateways\nonmerchant\paypal_payments_standard\views\default\process.pdt

is

$button_url = $recurring ? "https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_LG.gif" : "https://www.paypalobjects.com/en_US/i/bnr/horizontal_solution_PP.gif";

How can this be replaced with a plugin?

$button_url = $recurring ? "https://my.site.com/img1.gif" : "https://my.site.com/img2.gif";

The plugin doesn't even need any admin GUI. To change the image, just upload the new one as img1 or img2.

 

I've read all the documentation, but am not seeing how to do this. Any ideas?

 

FYI: This is done because core updates would overwrite the file with that code line.

Related conversation: http://www.blesta.com/forums/index.php?/topic/5091-change-paypal-button/

I don't see a way to change the views to custom, meaning a plugin is the only way.

 

Quite a few things that I want to do could be easily solved with this method. But I'm not sure how to start.

Link to comment
Share on other sites

Found it: http://www.blesta.com/forums/index.php?/topic/2532-change-paypal-buttons/

 

That was a thread from a year ago, and nothing ever came of it. (This is why I'm getting feed up with Blesta.) All that's needed is a simple image change for the core, and it's done. As the Cody said, Paypal is fugly. Their not-buttons "buttons" are not needed. A good UI button is all that is needed. Hell, I'll make one, and even paste the code change here. All the Blesta devs have to do is copy/paste it to core, and problem solved. (Come on guys, what do you say?)

 

My half-ass "fix" for now will be to clone the views folder. On update, I'll can rename/delete the new, and copy the clone to "default" restore it. But honestly, that's just more wasted time.
 

Link to comment
Share on other sites

Found it: http://www.blesta.com/forums/index.php?/topic/2532-change-paypal-buttons/

 

That was a thread from a year ago, and nothing ever came of it. (This is why I'm getting feed up with Blesta.) All that's needed is a simple image change for the core, and it's done. As the Cody said, Paypal is fugly. Their not-buttons "buttons" are not needed. A good UI button is all that is needed. Hell, I'll make one, and even paste the code change here. All the Blesta devs have to do is copy/paste it to core, and problem solved. (Come on guys, what do you say?)

 

My half-ass "fix" for now will be to clone the views folder. On update, I'll can rename/delete the new, and copy the clone to "default" restore it. But honestly, that's just more wasted time.

 

 

Let's see what you got :)

 

Looking at that thread, it doesn't look like there was ever a decision made on what exactly to do. If we are in agreement, it'll get a task and that task will get worked. Submit what you have and a screenshot and we will discuss.

Link to comment
Share on other sites

I'm not sure what you want a screenshot of. :unsure:

 

I did something like that years ago, but I don't remember when, or even what language (ASP? PHP?). When the code is being parsed, the plugin says "no you don't!" and replaces it. I vaguely remember it being vBulletin, back in 2009. Yeah, I think that's it. I took the basic function that was started, and edited it to do what was needed.

 

Anyway, it's replaced on-the-fly with this other code, thanks to a plugin that acts first.

 

That one plugin could be made to do everything I want! :)

- What a better menu? Replace it!

- Want to add a page? Replace code (to add it)! *

- Want a better image? Replace it!

 

* I needed a simple news page. I'm currently recycling "payment accounts" (useless for me) to make it. :P

 

All it needs is fields to store the code in the db. You can add as many replacements as desired. All it does is seek out X and replace with Y. I remember that aspect of the replacement. But it's been so long that I don't remember how I did it.

 

I wanted to start easy. A simple replacement just for this bit of code.

 

Does this all make more sense?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...