Jump to:

2088 Posts in 1007 Topics by 455 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » E-Commerce help - default country, shipping calculator, new payment method, paypal

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: 3240 Views
  • landscaper
    Avatar
    Community Member
    5 Posts

    E-Commerce help - default country, shipping calculator, new payment method, paypal Link to this post

    Hi,

    I'm trying to get a basic e-commerce site working but am having a few problems. Is there anyone out there who can help please?

    I am using Silverstripe 2.3.3, Ecommerce 0.6 beta 1 and Payments 0.1 beta 1 in a development environment running on Win XP/WAMP and a production environment on Unix (hosted with www.hostingshop.com.au).

    1. How do you default the country on the Checkout page to 'New Zealand'?

    Some of the documentation seems to inidcate that this is set based on the users IP address? I just want to have it default to 'New Zealand' and then have the customer choose a differerent country if required. Is there a command that could be put in _config.php?

    2. How do you implement a new payment method called 'Direct Credit'?

    I have copied \payments\code\ChequePayment.php to \mysite\code\DirectCreditPayment.php and changed all instances of 'Cheque' to 'DirectCredit'. I have inserted the following code in \mysite\_config.php
       Payment::set_supported_methods(array(
          'ChequePayment' => 'Cheque',
          'DirectCreditPayment' => 'Direct Credit',
          ));

    This seems to work but it doesn't display the text 'Please note: Your goods will not be dispatched until we receive your payment.' (or something similar) on the Checkout page when you select 'Direct Credit'. This seems to be set in CheckoutPage.php but I can't work out out to amend this.

    Is there anything else that needs changing when building a new payment method?

    3. Has anyone implemented a shipping calculator which calculates the shipping cost based on region and quantity i.e. $5 per item in NZ, $20 per item overseas?

    4. Has anyone manged to get PayPal (or PayMate) working with these versions of E-Commerce and Payments?

    Have a look at www.the-westons.net/babywrap1 to see where I have got to so far.

    Many thanks,
    Mark

  • landscaper
    Avatar
    Community Member
    5 Posts

    Re: E-Commerce help - default country, shipping calculator, new payment method, paypal Link to this post

    Hello,

    Is there anyone out there that can help me please?

    Regards,
    Mark

  • landscaper
    Avatar
    Community Member
    5 Posts

    Re: E-Commerce help - default country, shipping calculator, new payment method, paypal Link to this post

    Don't worry - I gave up on Silverstripe & went to Wordpress with WP-E-Commerce. This was so easy to setup and get running! Awesome functionality!

  • indietravel
    Avatar
    Community Member
    2 Posts

    Re: E-Commerce help - default country, shipping calculator, new payment method, paypal Link to this post

    Ironically, I'm having so many problems with one WP-ecom site that I'm looking at ss

  • ccburns
    Avatar
    Community Member
    74 Posts

    Re: E-Commerce help - default country, shipping calculator, new payment method, paypal Link to this post

    I am having exactly this issue at the moment. I have created a new payment method called DirectDebitPayment and have configured the payment method to show up, but unfortunately the message isn't showing up like I thought it might.

    I am going to go investigate the templates now to see if I can solve the problem. I will post back if I find a solution.

    Cheers,
    Colin

  • ccburns
    Avatar
    Community Member
    74 Posts

    Re: E-Commerce help - default country, shipping calculator, new payment method, paypal Link to this post

    Okay so this is what I have done. It may not be perfect but it works.

    In your new payment method file (I have created a new payment method called DirectDebitPayment. This is a direct copy of the ChequePayment file (ChequePayment.php) where I have simply changed the word Cheque with DirectDebit etc.

    In the function below there is a line that is supposed to display the additional message.

    This is the variable that does this in the ChequePayment method.

    $this->DirectDebitContent()

       function getPaymentFormFields() {
          return new FieldSet(
             // retrieve direct debit content from the DirectDebitContent() method on this class
             new LiteralField("DirectDebitblurb", '<div id="DirectDebit" class="typography">' . $this->DirectDebitContent() . '</div>'),
             new HiddenField("DirectDebit", "DirectDebit", 0)
          );
       }

    Unfortunately it doesn't seem to be populated in this class for some reason. I have simply removed the variable and replaced it with the actual text that I want.

    See the new function definition below.

       function getPaymentFormFields() {
          return new FieldSet(
             // retrieve direct debit content from the DirectDebitContent() method on this class
             new LiteralField("DirectDebitblurb", '<div id="DirectDebit" class="typography"><p class="warningMessage">' . _t('DirectDebitPayment.MESSAGE', 'Payment accepted via Direct Debit. Please note: products will not be shipped until payment has been received.') . '</p></div>'),
             new HiddenField("DirectDebit", "DirectDebit", 0)
          );
       }

    I thought I would add it to this thread just for anyone else's reference.

    Cheers,
    Colin

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