Separation of concerns for Marketpress store design

I've been integrating Marketpress over last few days and I know if ever an update comes out for it then it will be a lot of work for me again as it will most likely break a lot of my work.

I needed to change the HTML output so I could get it working with some js libraries. The only way to do this was to copy the template function php file and add modifications to my own functions.

This then meant I had to also change the ajax and I will also probably have to completely override the very long function that controls settings just to make a few small changes. I havent started on the cart yet but I am guessing it will be the same thing. Before long I will have most of the plugin inside my theme just because I wanted to override some HTML.

The code was easy to edit and well laid out which is nice but I am expecting total breakage on any updates.

If the presentation markup had more separation from the business logic then I could have done the majority of changes and have easier time when updates come.

I think the best way is to eliminate any logic and then have flat text templates where placeholders are replaced with values. I have coded something like this in a different language and it added a lot of overhead so I built caching system so only first load after a change has the extra overhead. I am new to wordpress & php so not sure if this approach would work here.

The other way would be to separate any html into a small function that takes an array of values, populates the text then returns the html. People could then easily override them without effecting any other logic. This would be fairly straight forward to implement I think as the current code is similar to this, it would just need some re-arranging.