AlexanderTheGr Posted October 20, 2008 Share Posted October 20, 2008 Hi there I need your help I am developing a online shop and a have a small problem Here is the code class orders { . . . function shipping_price() { ..... } function saturday_deliv_price() { ..... } function count_basket_total_price_items() { ..... } function count_total_basket_price() { $shipping_price = $this->shipping_price(); $saturday_deliv_price = $this->saturday_deliv_price(); $count_basket_total_price_items = $this->count_basket_total_price_items(); return $shipping_price+$saturday_deliv_price+$count_basket_total_price_items; } . . . } Then i call count_total_basket_price() class template { . . . . function top_header_my_basket() { echo "Price:".orders::count_total_basket_price()."€"; } . . . . } And i am receiving that error message Fatal error: Call to undefined method template::shipping_price() in ....../orders.class.php on line 80 It seems shipping_price which is part of orders class runs via template class. And i think that not suppose to happent any idea? Link to comment https://forums.phpfreaks.com/topic/129197-solved-php-bug-or-no/ Share on other sites More sharing options...
Bendude14 Posted October 20, 2008 Share Posted October 20, 2008 to use a function from your orders class your template class will have to extend it like so class template extends orders { Link to comment https://forums.phpfreaks.com/topic/129197-solved-php-bug-or-no/#findComment-669830 Share on other sites More sharing options...
AlexanderTheGr Posted October 20, 2008 Author Share Posted October 20, 2008 thx mate it seems it works now Link to comment https://forums.phpfreaks.com/topic/129197-solved-php-bug-or-no/#findComment-669853 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.