1

I use the extension "FME Extension" to add additional fields to my onepage checkout - the plugin ads the * after the label and I want to change it, so that the span starts before the label - as this is how the other fields of the form are displayed.

I can now navigate to:

app/local/FME/Fieldsmanager/Model/Fieldsmanager.php

and change the code as follows:

$html .='<div class="'. $class .'">';
if($NewFieldData['is_required']){ $html .="<span class='required'>*</span>";}   
$html .= '<label for="fm_'.$NewFieldData['attribute_code'] . '"';

Now the , that highlights the required fields, will be displayed before the label, but what happens if the extension gets updated? Is there any other way to change the code of local extensions but be safe in case the extension gets an update?

Thanks!

3

In an ideal world this display would not be controlled by a php file but use template files and so you can simply update the template file in your theme and thus getting around this issue when upgrading.

Without seeing the code I would suggest that you create your own module that rewrites model and function to include your changes.

As a side note you could also check what version of the extension has been installed and flag if the version is higher than you expected.

2

I see third party extensions often install into the local code pool and this is a good example of why that is a bad idea. Had it properly been assigned to the community code pool, you could simply update the file in the appropriate local code path and not worry about the extension updating or overwriting your changes in the future (aside from need to possibly update your modified file to reflect changes in the update).

Seeing a third party extension located in the local code pool should be a red flag, and you should try and "motivate" the extension developer to use the proper community code pool instead.

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.