richlewt Posted May 30, 2003 Posted May 30, 2003 Hi I am trying to combine the output from 2 different shipping modules. In the line below: $shipping_method = MODULE_SHIPPING_UKSD_TEXT_WAY . ' ' . $dest_state . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_UKSD_TEXT_UNITS; The variable $dest_state is derived from a different module, I need its output to display in this module, how do I get it to pick up the value of $dest_state ? thanks Rich "May the seam be with you"
Ian Posted June 3, 2003 Posted June 3, 2003 You need to know the class name of the other module, in that module $dest_state should have been defined as a var in the class contructor. You can then reference it with $class_name = 'cod'; // or whatever $dest_state = $GLOBALS[$class_name]->$dest_state; or you could just declare $dest_state as a global variable in the other module. Trust me, I'm an Accountant.
Ian Posted June 3, 2003 Posted June 3, 2003 Thinking about this some more, you are probably going to have problems getting variables from one shipping module to another. Each class function can be called on different checkout pages and also the sort order will play it's part too. Would it not be easier to copy over the code that calculates $dest_state from one module to another ? Trust me, I'm an Accountant.
richlewt Posted June 3, 2003 Author Posted June 3, 2003 Hi Ian I sussed it eventually. I put $dest_state = $order->delivery['state']; under Class Methods and it worked :D Am learning slowly but getting there!! thanks Rich "May the seam be with you"
Recommended Posts
Archived
This topic is now archived and is closed to further replies.