Jump to:

2082 Posts in 1002 Topics by 452 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Adding state and zip fields to checkout form

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1614 Views
  • jenniferaslan
    Avatar
    Community Member
    5 Posts

    Adding state and zip fields to checkout form Link to this post

    I'm new to this module (and relatively new to SilverStripe and PHP) and am learning to use the 0.6 beta version in an installation of SS 2.3.3. I see that this module is designed for people in Europe and other parts of the world, but I need to use it in a site that's primarily for a U.S. audience.

    I had found a post in the forums, that's nearly a year old, where someone had localized the module for the U.S., but the files provided don't work in this version of the module. I'm wondering how I go about adding State and Zip Code fields to the checkout page. I see on the documentation page there are some instructions for order form customization, but it doesn't tell you what file(s) to make the customization in. Can anyone point me to the file(s) that need editing for those new fields to get added to the database properly and to show up on the page, as well as get sent over to PayPal (the payment method I'm going to be using)? I'd actually like to completely remove the Country field as well.

    I'd also like to be able to make sure any dates are shown in MM/DD/YYYY format, if possible. I understand that this module shows them DD/MM/YYYY (or something similar).

  • mschiefmaker
    Avatar
    Community Member
    187 Posts

    Re: Adding state and zip fields to checkout form Link to this post

    I am still getting this worked out myself so I am not sure if this is the way to do it but if you open EcommerceRole.php and add
    new TextField('State', 'State'),
    new TextField('Postcode', 'Postcode'),

    in the function getEcommerceFields(). It will add the additional fields to the form but it doesn't introduce additional files to the order table. These can be added to the member table via the extraDBFields() function earlier in the same file.

    Cheers

    MM

    1614 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.