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

How i got the latest eCommerce trunk to work with paypal


Reply


39 Posts   6618 Views

Avatar
GRiiDWeb

Community Member, 60 Posts

13 April 2011 at 6:38am

Hi,
Looks good. Have previously got my API, but could do with a little guidance on configuring the new PayPal. I have 2 sites that would really benefit from it and once done you can see them as examples.
Is there a short wiki or assistance you could provide?

Many thanks.

Avatar
Jedateach

Forum Moderator, 232 Posts

18 April 2011 at 5:24pm

Here's the readme:
http://code.google.com/p/silverstripe-ecommerce/source/browse/modules/payment_paypal/trunk/README

I've also created a new download, which includes the readme:
http://code.google.com/p/silverstripe-ecommerce/downloads/detail?name=payment_paypal_1.1.zip

cheers,
Jeremy

Avatar
marc79

Community Member, 65 Posts

10 June 2011 at 10:17pm

HI CHD,

Been trying to get this ecommerce mod to work for ages now! Came across your post and thought I might be onto a winner, got everything downloaded and installed, but now nothing is being added to the cart.

I can add products, see them on the front end with 'Add to cart' link but nothing happens. The page seems to reload but the my cart box on the left remain empty and the go to cart link that used to appear has now gone.

I noticed that the code you added to you config file was slightly different to that provided in the ecommerce config file that it asks you to copy and paste over to the mysite/_config.php but it generally seems to be passing the same info.

I know this is a bit vague but do you have any thoughts on what could be causing this? Could this be a permissions issue?

Thanks

Marc

Avatar
Jedateach

Forum Moderator, 232 Posts

13 June 2011 at 8:37am

Hi Marc, what version of eCommerce are you using?

Avatar
GRiiDWeb

Community Member, 60 Posts

13 June 2011 at 8:56am

Hi marc79
I have a working version of the ecommerce now (I've put live for testing). Jedateach has help me out a lot.

The suggestion is to get all the latest versions from http://code.google.com/p/silverstripe-ecommerce/ and install those.
I've made some various template changes and made notes of all the code elements that need to be added to get it to a working state.
Currently I have it working on Jedateach's payment_paypal module.
Are you wanting to use it with PayPal? You will need to get the PayPal api settings as recomended in the Read Me file of this module.

If you need help beyond this I can give pointers.

GW

Avatar
marc79

Community Member, 65 Posts

14 June 2011 at 4:13am

Hi.

I had been using the Burnbright version as per CHD's post but will have a look at the link you've posted and try a fresh install of SS.

Yes, I was hoping to get it working with Paypal. I will have a look at Jedateach's module and let you know how I get on.

Thanks

Marc

Avatar
marc79

Community Member, 65 Posts

14 June 2011 at 9:35pm

Have now installed latest version of ecommerce 0.8.1 and payment which are both working fine and the shopping cart is now functioning correctly, adding items and allowing me to view the cart. Now I just need to remember how to switch on the PayPal bit.

Marc

Avatar
marc79

Community Member, 65 Posts

15 June 2011 at 9:52pm

Edited: 15/06/2011 10:25pm

Thanks again for our help GRiiDWeb.

I now have everything up and running which is fantastic. I am just trying to figure out two things.

One how to set the currency, I want to use GBP. I have set this in the mysite/_config.php but it still displays $ on the site.

And also I want to set up shipping costs so that the UK is free and anything overseas, Rest Of World, is £2. I have uncommented the settings in the _config.php but again no luck.

Below is the settings I have enabled so far in the config file.

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ start ECOMMERCE module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ___ ORDER
Order::set_modifiers(array());;
Order::set_email("marc@fifteen09.co.uk");
//Order::set_subject("Order #%d - Thank you for your order at margotdance.co.uk");
//Order::set_table_overview_fields(array());
//Order::set_order_id_start_number(1000);
//Order::$db["Status"] = 'Enum("New,Unpaid,PaymentConfirmed,QueryForCustomer,PartsOnOrder,Processing,Sent,Complete,AdminCancelled,MemberCancelled","New")';

// ___ ORDERFORMS
//TO BE IMPROVED USING EXTEND METHOD
//OrderFormWithoutShippingAddress::add_extra_field("tabName", new TextField("ExampleName");
OrderFormWithoutShippingAddress::set_fixed_country_code("UK");
//OrderFormWithoutShippingAddress::set_postal_code_url("http://www.nzpost.co.nz/Cultures/en-NZ/OnlineTools/PostCodeFinder");
//OrderFormWithoutShippingAddress::set_postal_code_label("find postcode");

/*
//adding /?BackURL= as part of the string will automatically add the right back URL!
OrderFormWithoutShippingAddress::set_login_invite_alternative_text('
   If you have ordered from us before you will need to <a href="Security/login/?BackURL=">log in</a>.
   To have your password reset link sent to you please go to the <a href="Security/lostpassword/?BackURL=">password recovery page</a>.
');
*/
//ExpiryDateField::set_short_months(true);

// ___ PAYMENT
Payment::set_site_currency('GBP');

// ___ MODIFIERS
SimpleShippingModifier::set_charges_for_countries(array(
'UK' => 0,
));
SimpleShippingModifier::set_default_charge(2);
//TaxModifier::set_for_country('NZ', 0.125, 'GST', 'exclusive');

// ___ PRODUCTS - TO BE MOVED TO SITE CONFIG
//Product::set_global_allow_purcahse(false);
//Product::set_thumbnail_size($width = 140, $height = 100);
//Product::set_content_image_width($width = 200);
//Product::set_large_image_width($width = 200);
//ProductGroup::set_page_length(12);
ProductGroup::set_must_have_price(true);
//ProductGroup::set_sort_options(true);

// *** CMS REPORTS
SS_Report::register('ReportAdmin','AllOrdersReport');
//SS_Report::register('ReportAdmin','CurrentOrdersReport');
//SS_Report::register('ReportAdmin','UnprintedOrderReport');

// ___ CMS MODELADMIN
//ProductsAndGroupsModelAdmin::set_managed_models(Array("Product", "ProductGroup"));
//StoreAdmin::set_managed_models(array('Order','Payment','OrderStatusLog', 'OrderItem', 'OrderModifier'));

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ end ECOMMERCE module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Do I need to make changes elsewhere in the code? Everything I have found seem to refer back to the mysite/_config.php so I a bit stuck.

If you can point me in the right direction for this that would be amazing.

Thanks

Marc

--EDIT--

HI, so I figured out how to get shipping to display:

Order::set_modifiers(array(
'SimpleShippingModifier'
));

However now it just seem to be ignoring the UK charge of 0 and displaying the default charge of 2, still displaying as $, that I had set. I am not sure if this is because by default the country is set Afghanistan (first, alphabetically) as when I select UK from the list there is nothing to recalculate the shipping cost indication that this has happened.

Any help would much appreciated.

Thanks in advance.

Marc