Results 1 to 8 of 8
  1. #1

    bug Additions in Shipping Modules

    Zen Cart 1.5.0
    Database Patch Level: 1.5.0
    PHP 5.3.5
    MySQL 5.1.54

    I'm sorry if this isn't posted in the correct section for this kind of post, it just seemed a relevant place for it.

    I need to update some shipping modules that are currently on my ZenCart site. In a nutshell I thought the best way to describe how it is now, and what I'd like to add was to do a fake "mockup" of the ideal shipping page compared to what it looks like now.

    ---

    Current Shipping Page Modules:


    Desired Shipping Page Modules:


    ---

    So as you can see I need to bolster the "Bill Receiver" module (which is currently the 'flat.php' module of ZenCart), and add a checkbox to the existing UPS module.

    I'd like the "Bill Receiver" section to have more fields for users so that we are able to get more specific information from them when using shipping methods that aren't UPS. These can just be carried through as strings of text like they would be in the notes section below - the problem is without prompts like these many users aren't providing adequate information in the notes section, thus requiring further communication with them to clarify desired shipping options.

    The UPS checkbox can be either checked or un-checked (though now that I think about it that should probably have a text field accompanying it as well, or an addition to it's note to designate the user's Account # in the notes section of the page), but one of the Shipping method radio buttons must be selected in this section.

    I don't know if I'm able to modify existing modules (from the files I've looked at concerning them there is no clear way to add elements like this to the individual modules and retain their functionality as shipping modules) but I could also make a new module and stop using the "flat.php" one that is "Bill Receiver" right now - if that's a better approach.

    Again, sorry if this is in the wrong section but after all the looking and tinkering I've done I haven't found a way to add such elements to existing shipping modules of ZenCart.

    Thanks!

  2. #2
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Additions in Shipping Modules

    You may want to do a search for "extra fields" in the title only, there are some clues how to tackle this.

  3. #3

    Default Re: Additions in Shipping Modules

    Quote Originally Posted by frank18 View Post
    You may want to do a search for "extra fields" in the title only, there are some clues how to tackle this.
    I found a lot of questions about adding fields to customer signup & login and/or product pages. But the shipping modules are way different. I can't discern from the php where each section of the modules comes from.

    I can see the <fieldset> tags in the shipping page template that seem to control all the modules. But I can't see in, for example, the flat.php document, where the html elements are generating let alone where their inputs are being saved and carried through the checkout process.

    I'm just lost in a sea of interweaving classes, objects, and arrays when looking in the shipping module files.

    Like I said, the inputs from the desired fields can just be carried over in the "notes" section if that easiest - so long as they're existent and labelled to be deciphered by the the person looking at the order in the end.

    But I'm entirely baffled as to how to add such elements and ensure such a carryover.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,477
    Plugin Contributions
    88

    Default Re: Additions in Shipping Modules

    The out-of-box Zen Cart doesn't support shipping modules that need additional information -- unlike the payment modules, which have a couple of call-back functions to display, take input and validate any additional inputs they might desire.

    That's not to say that it's not possible, it's just something you'll need to "bolt on".

  5. #5

    Default Re: Additions in Shipping Modules

    Quote Originally Posted by lat9 View Post
    The out-of-box Zen Cart doesn't support shipping modules that need additional information -- unlike the payment modules, which have a couple of call-back functions to display, take input and validate any additional inputs they might desire.

    That's not to say that it's not possible, it's just something you'll need to "bolt on".
    I see.

    This is something I sort of expected. If I understand correctly, I could add (or use an add-on to add) a new shipping module [of my own creation] with the desired fields?

    If so, what is the first step in doing something like this?

  6. #6
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Additions in Shipping Modules

    Quote Originally Posted by lat9 View Post
    The out-of-box Zen Cart doesn't support shipping modules that need additional information -- unlike the payment modules, which have a couple of call-back functions to display, take input and validate any additional inputs they might desire.

    That's not to say that it's not possible, it's just something you'll need to "bolt on".
    Quote Originally Posted by RobertH View Post
    I see.

    This is something I sort of expected. If I understand correctly, I could add (or use an add-on to add) a new shipping module [of my own creation] with the desired fields?

    If so, what is the first step in doing something like this?
    As Zen Cart is open-source, yes the code can be manipulated to do as you desire.

    Last time I needed to do this, it involved:
    • Modifications to the currently selected theme's tpl_checkout_shipping_default.php (for selection).
    • Modifications to the currently selected theme's tpl_checkout_confirmation_default.php (for display).
    • Added (or modified an existing) shipping module (added function to output additional fields).
    • Added an observer (to listen for the shipping selection to record in database and order comments).
    • Added language files for the shipping module, templates, and observer (easy to change text and support multiple customer languages).


    The above path avoids modifying any core Zen Cart files (so upgrades are not too painful), but if one changes the Zen Cart theme one will need to add the template files to the new theme (or merge them into the new theme).
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  7. #7

    Default Re: Additions in Shipping Modules

    Quote Originally Posted by lhungil View Post
    As Zen Cart is open-source, yes the code can be manipulated to do as you desire.

    Last time I needed to do this, it involved:
    • Modifications to the currently selected theme's tpl_checkout_shipping_default.php (for selection).
    • Modifications to the currently selected theme's tpl_checkout_confirmation_default.php (for display).
    • Added (or modified an existing) shipping module (added function to output additional fields).
    • Added an observer (to listen for the shipping selection to record in database and order comments).
    • Added language files for the shipping module, templates, and observer (easy to change text and support multiple customer languages).


    The above path avoids modifying any core Zen Cart files (so upgrades are not too painful), but if one changes the Zen Cart theme one will need to add the template files to the new theme (or merge them into the new theme).
    I'm not advanced enough in the php side of things here to understand what things I need to modify to get all these files to work together properly. Looking at the tpl_checkout files I really don't know what I'm looking at most of the time. Like I said before for example I can see the <fieldset> tags and in looking at the page structure in a browser I can see the the fields appear as <fieldsets> but I don't really understand the calls that are putting them together from the php to the live page.

    I can do enough HTML to form these elements in the correct layout, and I know a little php (I thought I was a little stronger in the php area until taking on this project) but I'm just not seeing where the changes need to happen. I'm looking for piece A, B, C that appear on the page and add my own elements in between them where I need them to appear but I don't see the pieces - and even if I could inject what I needed I'm not sure I could make the inputs follow through the checkout process successfully.

    Would you (or any other Zenner) be able to help me go through the steps to implement changes like these? Maybe just some hints on what I should be looking for in these files and what needs to be modified/added to correctly carry the changes through the full checkout process?

  8. #8

    Default Re: Additions in Shipping Modules

    Sorry for the double post.

    If anyone has some extra advice on making these modifications, or any different ideas for how to go about it I would really appreciate the assistance.

 

 

Similar Threads

  1. v150 USPS Shipping Module does not show up under Modules/Shipping
    By JavaGoldMan in forum Addon Shipping Modules
    Replies: 30
    Last Post: 19 Aug 2017, 11:30 PM
  2. Admin Shipping Mod Area not showing all shipping modules
    By MB1 in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 18 Feb 2012, 11:08 PM
  3. Replies: 1
    Last Post: 31 Dec 2010, 07:23 PM
  4. Do I need to update shipping modules for end-of-year shipping rate updates?
    By DBB1 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 4 Jan 2009, 05:55 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR