Jump to:

2082 Posts in 1002 Topics by 452 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Use Shipping Address Issue

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: 1676 Views
  • neonfrog
    Avatar
    Community Member
    10 Posts

    Use Shipping Address Issue Link to this post

    How does one stop the validators when one clicks "use different shipping address". This issue has been annoying the hell out of me. Next to this how does one prevent the form fields being cleared when OrderForm useDifferentShippingAddress function does a redirectBack()

    These two issues are a major usability problem.

    Has anyone sorted them out appart from removing the use different shipping address fields which are actually a useful feature?

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Use Shipping Address Issue Link to this post

    Extend the validator to either cut the JS altogether or get to writing some Prototype to skip on click from the href selector

    class MyAwesomerValidator extends RequiredFields {

    public function javascript() {
    // return ''; to get rid of all validation

    // or do something smart like
    if ($this->form->Name() == 'ShippingForm'){ add smart custom code }
    }

    }

    The next step would be to use useCustomClass() to replace the annoying shipping form to one that extends it and uses the MyAwesomerValidator instead. Or if you write it smartly you could replace RequiredFields instead.

    As for the redirectBack(), that is just not how things work. Don't forget this module is still in beta.

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Use Shipping Address Issue Link to this post

    +1 for thinking this is pretty annoying.

    (ps: did you succeed at turning it off?)

  • jhirm
    Avatar
    Community Member
    21 Posts

    Re: Use Shipping Address Issue Link to this post

    Agreed, annoying as hell. The ecommerce module has so many usability quirks/annoyances that it's practically unusable without significant modification. I guess that's why it's still in beta, and is an unsupported module. Maybe one of these days when I have some free time (ha!) I'll put together and post a version of the module that includes the basic set of changes I make every time I'm forced to use it. Word on the street is that the next version of SS will use jQuery instead of Prototype, which would be nice.

    To fix the problem mentioned here, I modified the OrderForm so that it always shows a Shipping Address fieldset with a checkbox at the top (Ship to Billing Address) that auto fills from the billing to the shipping fields. Then I do all the validation with jQuery. It's not perfect, but it's infinitely more usable than the default, in my opinion.

    See www.yellowstonecheese.com/checkout/ as an example.

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: Use Shipping Address Issue Link to this post

    Hey guys,

    I've been working on an eCommerce site and i got round this by overriding the validate() method in OrderForm.php.

    I copied the method, and replaed the first if condition with:

          if($this->validator && !isset($_REQUEST['action_useDifferentShippingAddress']) && !isset($_REQUEST['action_useMemberShippingAddress'])){

    Hope that helps you guys.

  • grumpypanda
    Avatar
    Community Member
    32 Posts

    Re: Use Shipping Address Issue Link to this post

    Hi there,

    I'm trying to fix someone else's code, and running into the form fields being cleared when OrderForm useDifferentShippingAddress function does a redirectBack() issue. Anyone found a solution for it in the end to prevent fields to be cleared? Please help.

    Thanks a lot.
    Sam

    1676 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.