After update Marketpress

After updating Marketpress:

Lightbox for featured image:
I use another plugin for the lightbox. The result was that I had two light boxes.
Nice but a little overdone.

I disabled in /wp-content/plugins/marketpress/marketpress-includes/template-functions.php on line 1915
$class = ' class="mp_product_image_link mp_lightbox"';
//$class = ' class="mp_product_image_link mp_lightbox"';
After that it is working great.

Languages files (mo and po)
I also lost my additional languages files for Italian and English.

Not a big deal, I had a backup, only a little bit more work.
Is there a way to prevent this when you are updating to a newer version

  • aristath
    • Recruit

    Hello there @Ella!

    Unfortunately when a plugin is updated the folder is deleted and then re-created from the newly-updated file. There's no easy fix for this...
    You can try one of these options:

    1. Change the permissions of your language files and make them read-only by your webserver. This way they will not be deleted when updating the plugin. Unfortunately this way the changes to the template-functions.php file will be overwritten.

    2. You could simply not automatically update the plugin and manually update the files you wish (NOT recommended... a lot of things can go wrong this way and it may crash your site if you don't know what you're doing).

    3. This solution will require some custom coding on your part but is the solution I would recommend:
    Copy the functions you want from the template-functions.php to your theme's .php file. Rename ALL functions from mp_* to ella_mp_*
    For example the mp_product_image function should become ella_mp_product_image
    You can do some simple search and replacing there, nothing hard!
    Then, in your template files you 'll have to replace all references to mp_product for example with ella_mp_product.

    Now your custom functions will be used instead of the original MarketPress functions and you can tweak them as much as you want!! They will never be overwritten since they are now in your theme and not a plugin. :slight_smile:

    I hope that helps!


  • Ella
    • The Incredible Code Injector

    Hi @aristath,

    Thank you very much for your answer.
    That with the languages files is a simple solution. I like that :slight_smile:

    For the function template-functions.php i even understand that!
    You are good today :slight_smile:


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.