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

Ecommerc error


3 Posts   807 Views


Community Member, 2 Posts

31 January 2013 at 5:25am


After installing payment v.30 and running dev/build?flush=1, I get the following error:

Parse error: syntax error, unexpected T_IF in /home/gemc/public_html/gemc21/cms/ecommerce/code/model/Order.php on line 1978

I need some help resolving this issue.



Community Member, 2 Posts

31 January 2013 at 5:30am

I forgot the line code:

    * Returns the country code for the country that applies to the order.
    * It only takes into account what has actually been saved.
    * @return String (country code)
   public function Country() {return $this->getCountry();}
   public function getCountry() {
      $countryCodes = array(
         "Billing" => "",
         "Shipping" => ""
      if($this->BillingAddressID) {
         $billingAddress = BillingAddress::get()->byID($this->BillingAddressID)
Line 1978    if($billingAddress) {
            if($billingAddress->Country) {
               $countryCodes["Billing"] = $billingAddress->Country;
      if($this->ShippingAddressID && $this->UseShippingAddress) {
         $shippingAddress = BillingAddress::get()->byID($this->ShippingAddressID)
         if($shippingAddress) {
            if($shippingAddress->ShippingCountry) {
               $countryCodes["Shipping"] = $shippingAddress->ShippingCountry;
      if(count($countryCodes)) {
         if(EcommerceConfig::get("OrderAddress", "use_shipping_address_for_main_region_and_country") && $countryCodes["Shipping"]) {
            return $countryCodes["Shipping"];
         return $countryCodes["Billing"];


Forum Moderator, 53 Posts

31 January 2013 at 11:32am

Looks like you are missing semicolons at the end of these lines:
$billingAddress = BillingAddress::get()->byID($this->BillingAddressID);
$shippingAddress = BillingAddress::get()->byID($this->ShippingAddressID);

You should try using an editor that will highlight syntax errors for you, I personally use Sublime Text 2 and it's pretty good.