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.

We've moved the forum!

Please use for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

Extending the Order class

Go to End

2 Posts   1543 Views


Community Member, 12 Posts

12 March 2015 at 9:26am

Edited: 12/03/2015 9:50am


I have the following extension

class GST extends Extension {

	private static $casting = array(
		'GST' => 'Currency'

	public function GST(){
		$config = SiteConfig::current_site_config();
		$base_charge = $this->owner->Total;
		return $base_charge * ($config->GST/100);


with the following in the app.yml
    - GST

The function works as desired, however it is generating a
[Notice] Trying to get property of non-object

Which while not a major problem outside of a dev environment, I am wondering how to stop it coming up. I get the feeling I am missing something very basic here.


Community Member, 87 Posts

15 March 2015 at 3:47am

If you setup error logging you might see what line of your code throws the Notice.