T. Thomas Posted February 16, 2014 Share Posted February 16, 2014 I'm trying to modify my shopping_cart.php to display the amount left until free shipping kicks in. I'm usually able to reverse engineer simple mods like this but I'm unable to find the php variables needed to correctly calculate and display what I'm trying to do. Basically: If(total_amount > free_shipping_amount){ display ("You get free shipping!") else display ("You still need" + (free_shipping_amount - total_amount) + " to get free shipping.") I want to get the current shopping cart total and the amount needed for free shipping (which is hard because I can't find anywhere its referenced). I could use hard numbers but that would mean me having to hand code it in every time I update the free shipping price. I just want to be able to set it in the back end and then have the php work on the front end without updating it every time. So I guess my question is whats the name of the variables to access the shopping carts "total amount" and the web stores "free shipping price" in shopping_cart.php? Link to comment Share on other sites More sharing options...
mhsuffolk Posted February 16, 2014 Share Posted February 16, 2014 This add on will do that, click the appropriate version below. 2.2 2.3 Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions. Link to comment Share on other sites More sharing options...
T. Thomas Posted February 23, 2014 Author Share Posted February 23, 2014 @@mhsuffolk Thanks for the reply but the addons you've mentioned isn't really what I'm looking for. I'm looking to pretty much implement this using the method I've mentioned in my initial post using the two variables I've mentioned in my initial post. Also there are a couple things preventing me from using the addon you mentioned; The first is that its in french so I don't really know or understand any of the comments, the second is that it seems to be doing things and changing files that aren't relevant to what I'm trying to do and I can't seem to figure it out because all of the comments and instructions are in french. I'm just looking for the two variables present in shopping_cart.php that are responsible for “Current shopping cart balance” and “Free Shipping Threshold” All of the coding after that I can figure out on my own. Link to comment Share on other sites More sharing options...
burt Posted February 23, 2014 Share Posted February 23, 2014 http://www.clubosc.com/how-much-to-spend-for-free-shipping.html Link to comment Share on other sites More sharing options...
T. Thomas Posted February 23, 2014 Author Share Posted February 23, 2014 @@burt Thank you... This is exactly what I was looking for, nice and simple. Your code and the corresponding explanation was so clear I was also able to change my shipping.php to reflect any updates to the free shipping module on the back end. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.