2004 Posts in 533 Topics by 435 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, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 319 Views |
-
Ecommerc error

31 January 2013 at 5:25am
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!
-
Re: Ecommerc error

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"];
}
} -
Re: Ecommerc error

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.
| 319 Views | ||
|
Page:
1
|
Go to Top |


