Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

E-Commerce Modules

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

E-Commerce help - default country, shipping calculator, new payment method, paypal


Reply

6 Posts   3254 Views

Avatar
landscaper

11 August 2009 at 7:43pm (Last edited: 15 August 2009 1:20pm), Community Member, 5 Posts

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

Avatar
landscaper

15 August 2009 at 1:19pm Community Member, 5 Posts

Hello,

Is there anyone out there that can help me please?

Regards,
Mark

Avatar
landscaper

21 August 2009 at 5:30am Community Member, 5 Posts

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!

Avatar
indietravel

19 September 2009 at 12:22pm Community Member, 2 Posts

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

Avatar
ccburns

30 September 2009 at 8:12pm Community Member, 74 Posts

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

Avatar
ccburns

30 September 2009 at 9:45pm Community Member, 74 Posts

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