Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Free Gift Contrib - Having trouble with this


nuptiara

Recommended Posts

Posted

Picked up short bit of code from contrib, link below

 

http://www.oscommerce.com/community/contri...earch,free+gift

 

followed instructions; Added free gift in unnamed catagory, found cpath, etc. and added following code to shopping_cart.php in Catalogue.

 

<?php if ($cart->show_total()>=99) { ?>

 

<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color=red> <a href="http://(this is where I have put the link to the gift)">You have spent enough for a free gift.<b> Click here </B>to choose one if you haven't already </a></font>

 

<?php

} else {

 

echo "<font face=Verdana size=2 color=red><b>";

echo "You only have to spend ";

echo $currencies->format(-$cart->show_total()+99);

echo " more to receive your free gift.</b>";

echo "</font>";

} ?>

 

Ran it in my test environment (standard Oscommerce install) and it doesnt even seem to be getting as far as checking the current cart total in shopping_cart.php, with no errors reported.

Any help appreciated, I am doing my best to learn PHP. Pitty me I am a Lotus Notes developer by trade!

Ali

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...