ianblackford Posted April 22, 2008 Posted April 22, 2008 I need to be able to check the value of $order_total in the checkout_shipping.php page, can anybody tell me please how to return this value? Thanks in advance. Ian
ianblackford Posted April 23, 2008 Author Posted April 23, 2008 Thanks for that, but I'm not good with PHP so I'm confused. Let me explain what I'm trying to achieve: I found a mod that will remove delivery options if the order total is above certain break points, here it is: if ( ($this->enabled == true) && ($order_total <100) ) { $this->enabled = false; return; } you drop this into your various shipping modules and change the 100 figure to your chosen break point. My problem is (at least I think this is my problem) $order_total is not a value on the page. I tried to drop: $cart->show_total() into the page but it came back with a Fatal Error. So I suppose the question I should have asked in the first place is how do I get the order total value into the code above in a shipping module that's included in the checkout_shipping.php page? Thanks again for the help Ian
ianblackford Posted April 24, 2008 Author Posted April 24, 2008 Help! I'm really stuck with this and I could do with some help real quick please. Is there a simple SQl statement that I can drop into a page and obtain the current carts order total and then set that total as $order_total so I can check it like this: if ( ($this->enabled == true) && ($order_total <15) ) { $this->enabled = false; return; } Ultimately I only want to show shipping rates that are applicable to the order value. ie: an order of £300 needs to be couriered so, the £3.50 cost saver rate can't be displayed. I thought the above code would help with that but I don't seem to have the value for $order_total availble on the page. I honestly need fast help with this because my client is getting frustrated with me (understandably) If anyone has any advice or know how I would really appreciate it.
arietis Posted April 25, 2008 Posted April 25, 2008 I tried to drop: $cart->show_total() into the page but it came back with a Fatal Error. what as the error message? it might be that you just need to include the class definition, but without seeing what the error is we can't really help. :)
ianblackford Posted April 25, 2008 Author Posted April 25, 2008 what as the error message? it might be that you just need to include the class definition, but without seeing what the error is we can't really help. :) Hi thanks for the reply - I've actually solved this a different way now by doing table price based shipping, I had a good trawl through all the options and have managed to do what I want now. Now I've moved on to SSL and trying to get that to work... with no joy! (Know anything about SLL? :'( )
markg-uk Posted April 25, 2008 Posted April 25, 2008 Its probably easier if you insert the said code into the shipping module itself which can then do code to decide whether to display that shipping method or not. I used this contribution, if you look at the rmspecial.php file, when the order goes above a certain amount, it gets disabled.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.