Jump to:

2084 Posts in 1005 Topics by 453 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Ecommerc error

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: 698 Views
  • Mogul1914
    Avatar
    Community Member
    2 Posts

    Ecommerc error Link to this post

    Hi,

    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.

    Thanks!

  • Mogul1914
    Avatar
    Community Member
    2 Posts

    Re: Ecommerc error Link to this post

    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"];
          }
       }

  • frankmullenger
    Avatar
    Forum Moderator
    51 Posts

    Re: Ecommerc error Link to this post

    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.

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