Jump to:

2088 Posts in 1008 Topics by 455 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » MemberProfiles Module playing nice with the SwipeStripe Ecommerce Module

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: 950 Views
  • helenclarko
    Avatar
    Community Member
    25 Posts

    MemberProfiles Module playing nice with the SwipeStripe Ecommerce Module Link to this post

    Hi All,

    I have been using Swipestripes eCommerce module (v1.0.1), but have found it lacks the ability to edit the users created by the shopping cart.

    In an attempt to solve this issue I installed Ajshort's Memberprofiles Module, which is brilliant and I highly recommend it.
    The only issue I face at this point is, the module doesn't seem to play nice with Swipestripe eCommerce module.
    I can create users (with address) and login, but whenever I checkout Swipestripe hasn't picked up the shipping address and even asks me to create an account to continue (however I am already logged in on an account created by Memberprofiles).

    Is there an easy way I can copy Swipestripes address field information over to MemberProfiles?
    So that when any user is created using MemberProfiles, it is creating the correct fields in the MySQL database for Swipestripe.

    EDIT: After talking to Frank at SwipeStripe I have found that it is currently not possible to use MemberProfiles along side SwipeStripe.

    Thanks,
    -helenclarko

  • Dr. J
    Avatar
    Community Member
    8 Posts

    Re: MemberProfiles Module playing nice with the SwipeStripe Ecommerce Module Link to this post

    In case somebody else comes this way, I believe I managed to achieve the outcome you were after by grabbing the neat and lightweight registration module from Aram at SS bits: http://www.ssbits.com/tutorials/2010/site-members-registering-users-and-allowing-them-to-edit-their-details/. The trick is to create a Customer and associate it with the customers group rather than leaving it as a simple Member.

    So after downloading and installing the Registration and SwipeStripe modules in the usual way, I modified the doRegister method in RegistrationPage_Controller by commenting out the original Member creation code and replacing it with the necessary lines from ProcessOrder of the CheckoutPage_Controller in the SwipeStripe module:

          /** -- Original implementation by Aram
          //Otherwise create new member and log them in
          $Member = new Member();
          $form->saveInto($Member);         
          $Member->write();
          $Member->login();   
          
          //Find or create the 'user' group
          if(!$userGroup = DataObject::get_one('Group', "Code = 'users'"))
          {
             $userGroup = new Group();
             $userGroup->Code = "users";
             $userGroup->Title = "Users";
             $userGroup->Write();
             $userGroup->Members()->add($Member);
          }
          //Add member to user group
          $userGroup->Members()->add($Member);
          **/
          
          // New implementation taken from SwipeStripe
          $member = new Customer();   
          $form->saveInto($member);      
          $member->write();
          $member->addToGroupByCode('customers');
          $member->logIn();
          

  • helenclarko
    Avatar
    Community Member
    25 Posts

    Re: MemberProfiles Module playing nice with the SwipeStripe Ecommerce Module Link to this post

    Thank you,

    I will have to try this out.

    -helenclarko

  • helenclarko
    Avatar
    Community Member
    25 Posts

    Re: MemberProfiles Module playing nice with the SwipeStripe Ecommerce Module Link to this post

    Hey Dr. J,

    The code you provided worked perfectly.
    Thank you very much

    Thanks again
    -helenclarko

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