Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2009
    Posts
    27
    Plugin Contributions
    0

    Default Modifying index.php?main_page=checkout_shipping to add disclaimer?

    I am using the latest version of the store, with Cold Steel template. I'm just about done but I want to add a shipping disclaimer to the page where you select your shipping option (index.php?main_page=checkout_shipping)

    I know which PHP file to edit, but I'm not sure how to get it to display. I attempted to add this where I wanted it to show up:


    Code:
    define('TEXT_INFORMATION','Inserting shipping message here.');
    But it wouldn't display. Being a noob to editing templates, the only thing I can guess is perhaps there's no 'TEXT INFORMATION' I can tuck in. All other pages I've edited already have the option in place - I just had to edit the text defined within. Help?

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,269
    Plugin Contributions
    3

    Default Re: Modifying index.php?main_page=checkout_shipping

    Well you got it half right...

    There are 2 ways to do it

    1. the easy (improper) way
    2. the more detailed (proper) way

    The Easy way just requires you to HACK in a line of html, encase in a DIV

    The proper way requires you do this

    Create this line, then put it into
    includes/templates/template_default/templates/tpl_checkout_shipping_default

    in an appropriate place (ie: where you want it to appear in the page layout)

    PHP Code:
    <div id="checkoutShippingDisclaimer" class="important"><?php echo TEXT_SHIPPING_DISCLAIMER?></div>
    ----------------------------------------------------------------

    Then create this line:
    PHP Code:
    define('TEXT_SHIPPING_DISCLAIMER''Your disclaimer text here.'); 
    And insert it into

    languages/english/checkout_shipping.php

    -----------------------------------------------------------------

    Strictky speaking, as these are now EDITED files, you should not overwrite the CORE files, but rather save these to your CUSTOM folders.

    ------------------------------------------------------------------

    As you have given this new div an ID...

    checkoutShippingDisclaimer

    You can create styles for it in the stylesheet

    Code:
    #checkoutShippingDisclaimer {color: #FFF000}
    20 years a Zencart User

  3. #3
    Join Date
    Oct 2009
    Posts
    27
    Plugin Contributions
    0

    Default Re: Modifying index.php?main_page=checkout_shipping to add disclaimer?

    Thanks!

    I'd currently been just renaming my original files with OLD somewhere in the name. So if I put it in the CUSTOM folder, the store automatically knows to have all files there override the others?

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,269
    Plugin Contributions
    3

    Default Re: Modifying index.php?main_page=checkout_shipping to add disclaimer?

    Not exactly...

    Be careful about editing and re-naming CORE files...

    CORE files should be lefyt intact when there is an over-ride possibility available.

    ALL zencart stores should work off a CUSTOM template (See FAQ for setting this up). The vast majority of files that ever need to be edited by most store owners are files that should obey the over-ride principle.

    Basically, the over-ride principle is this...

    By having a CUSTOM template, when zencart looks for various PHP (and other) files, it will FIRST look in a custom template folder.

    If it finds the PHP file it needs in that folder, then that is the file it will use.

    If it does NOT find the file it is looking for, then it will use the CORE file instead.

    So you only ever create a custom (over-ride) file when your edits depart from the core equivalent.

    FOR EXAMPLE:

    I install and configure a CUSTOM template called patches.

    Let's say that I want to change the DEFINE for the following line:
    PHP Code:
    define('TABLE_HEADING_COMMENTS''Special Instructions or Comments About Your Order'); 
    I discover that the line is contained in:

    includes/launguages/english/checkout_shipping.php

    That is a CORE file.

    So I makev a copy of that file and edit it, changing the line to:
    PHP Code:
    define('TABLE_HEADING_COMMENTS''Please insert any comments, and - if applicable - your Purchase Order Number'); 
    Then I save the file and FTP it to:

    includes/launguages/english/patches/checkout_shipping.php

    This is my OVER-RIDE and because it is in an over-ride folder, zencart will use it before using the CORE file of the same name.

    If I edit this again and make a big botch up I can recall the CORE file, copy it and edit again.

    The CORE file has retained its integrity as it never gets edited.
    20 years a Zencart User

  5. #5
    Join Date
    Oct 2009
    Posts
    27
    Plugin Contributions
    0

    Default Re: Modifying index.php?main_page=checkout_shipping to add disclaimer?

    Okay... I think I'm starting to understand. I'm looking at the Override System faq right now. I was hoping the solution would be a lot faster, but this will be good to know in the long run. :)

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,269
    Plugin Contributions
    3

    Default Re: Modifying index.php?main_page=checkout_shipping to add disclaimer?

    Quote Originally Posted by seian View Post
    this will be good to know in the long run. :)
    It's essential in the "short run" too.

    The FIRST thing one should do (after basic install config) is build a custom template - it takes literally 5 minutes...

    Do this BEFORE anything else is done, and a huge number of potential problems will be avoided in future.

    I cannot overstress the need (and value) of the over-rides system.
    20 years a Zencart User

  7. #7
    Join Date
    Oct 2009
    Posts
    27
    Plugin Contributions
    0

    Default Re: Modifying index.php?main_page=checkout_shipping to add disclaimer?

    Okay, I've been looking into it and one thing I'm unsure of is which custom file would dominate? To my mind, Cold Steel (the template I am using) is already a CUSTOM, as over-rides go. I can see some template files in there that look like they act as overrides to the master template.

    If I want to put in edits to a file, what's to say that it'll listen to my new custom file when it's also in the Cold Steel folders? It seems at some point custom files will start competing with eachother. Which wins? And which should exist?

  8. #8
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,269
    Plugin Contributions
    3

    Default Re: Modifying index.php?main_page=checkout_shipping to add disclaimer?

    You can only use ONE template at a time...

    Zencart will know which one you are using, and will base all its calls on that template.

    I have some sites with 6 or 7 templates embedded - (different skins for different sales seasons), but only ONE template can ever be active.

    So. let's say you have one custom template called cold_steel

    and another called ronnie_obama

    ------------------------------------------------------------------------

    You decide you don't like cold_steel anymore, and in the

    admin >>> tools >>> template selector


    you switch over to the ronnie_obama template.

    ------------------------------------------------------------------------

    Now, you may want SOME customizations that existed in cold_steel to NOW ALSO be in ronnie_obama.

    Let's say you want this file to be in ronnie_obama...

    includes/languages/english/cold_steel/index.php


    ------------------------------------------------------------------------

    You will need to COPY it, and put that copy into:


    includes/languages/english/ronnie_obama


    So you get...


    includes/languages/english/ronnie_obama/index.php


    ------------------------------------------------------------------------

    cold_steel still has its copy of index.php - but as that template is UN-SELECTED, the file just lies dormant...
    20 years a Zencart User

  9. #9
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,269
    Plugin Contributions
    3

    Default Re: Modifying index.php?main_page=checkout_shipping to add disclaimer?

    If you want to know where your over-rides folders should sit, the rule is simple...

    MOST of the overrides will be in

    languages
    modules
    templates

    So, navigate through these folders and ALL their sub-folders...

    ... wherever you see a classic folder, you ought to have an over-ride folder named after your custom template.

    As you are using cold_steel now... your over-ride system will have a cold_steel folder at the same level as every classic folder.

    These can be empty - - - until you need to put an over-ride file into them.

    Look inside the classic folders too... some have stuff like "empty.txt" or "index.html".

    If a classic folder has such contents, your override folder (at the same level) should also have these contents - so just copy what's in the classic folder and put it into your override folder.
    20 years a Zencart User

  10. #10
    Join Date
    Oct 2009
    Posts
    27
    Plugin Contributions
    0

    Default Re: Modifying index.php?main_page=checkout_shipping to add disclaimer?

    Thanks! I think I get it now. I appreciate you going over it so thoroughly. I like the system now that it is making sense to me.

 

 

Similar Threads

  1. How to add banner to index.php?main_page=index&cPath=0 ?
    By Alexiss in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 31 Oct 2011, 04:55 PM
  2. change /index.php?main_page=index to just / with ceon uri?
    By new2u in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 29 Jan 2010, 02:06 AM
  3. Replies: 0
    Last Post: 26 Oct 2007, 12:55 AM
  4. Change the index.php?main_page=index and where it links to
    By tqualizer_man in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 25 Nov 2006, 01:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg