geoffhumphrey / brewcompetitiononlineentry

https://brewingcompetitions.com
78 stars 80 forks source link

Ability to Change "Packing and Shipping Instructions" missing #833

Open ercousin opened 6 years ago

ercousin commented 6 years ago

It seems that we are not able to change the text in the Packing and Shipping instructions at the moment. I think this text should be customizable, especially since it specifically mentions USPS, when I would rather it mention Canada Post.

image

geoffhumphrey commented 6 years ago

If you have access to the source files, you can change the text by altering or overriding the $entry_info_text_038, $entry_info_text_039, $entry_info_text_040, $entry_info_text_041 and $entry_info_text_042 variables in the /lang/en/en-US.lang.php file.

A way to approach this could be to utilize the custom modules feature, enabled via preferences. This way would ensure that the text is always customized should you upgrade to a newer version in the future.

  1. Enable the feature via Admin > Website Preferences
  2. In a text editor, create a simple php file that will override variables and save it. Be sure to enclose the variable in php tags. A simple example is:
    <?php
    $entry_info_text_038 = "CUSTOM SHIPPING TEXT HERE"; // Packing instructions
    $entry_info_text_039 = "CUSTOM SHIPPING TEXT HERE"; // Write fragile
    $entry_info_text_040 = "CUSTOM SHIPPING TEXT HERE"; // Enclose entries in zip-top bag
    $entry_info_text_041 = "CUSTOM SHIPPING TEXT HERE"; // Broken bottles text
    $entry_info_text_042 = "CUSTOM SHIPPING TEXT HERE"; // USPS text
    ?>
  3. Upload the file to the /mods/ directory via FTP.
  4. Navigate to Admin > Preferences/Customization > Custom Modules > Add to add the customization to the system.
  5. Make sure that the Type is Information (Basic HTML), the Permission is All Users, Extends Core Function is set to All, and the Display Order is Before Public Core Content and the module is enabled.

This approach can extend to any variable listed in the /lang/en/en-US.lang.php file as well.

ercousin commented 5 years ago

Hi Geoff,

I tried creating a custom module in mods/custom_shipping_instructions.php, however after enabling it with the instructed settings every page on the site is blank. Any ideas?

How can I re-disable the mod without access to Admin Dashboard?

<?php
$entry_info_text_038 = "Please visit the <a href="https://www.gtabrews.ca/brew-slam/rules-and-instructions/">Competition Rules page</a> of our website for packing and shipping instructions."; // Packing instructions
$entry_info_text_039 = ""; // Write fragile
$entry_info_text_040 = ""; // Enclose entries in zip-top bag
$entry_info_text_041 = ""; // Broken bottles text
$entry_info_text_042 = ""; // USPS text
?>
ercousin commented 5 years ago

Okay editing the custom_shipping_instructions.php file through cPanel File Manager did the trick. I guess href wasn't okay there.

Is there a way I can add a hyperlink in this custom text?