Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hi all. I found a contribution to do this but it also says that the code will allow multiple free gifts. Is there a way not to allow multiple free gifts to be added? Here is the text from the mod. if that helps:

 

OSC Free Gift Contribution

By Norman Hinks. With  help from G.Waudby

 

 

This is a basic code addition to provide a free gift option to most stores. I'm using it on MS2.2 and it works fine with the DHTML Menu active.

 

Set up a category for your free products but do not give it a name, set its position to 99. This ensures its the last thing on the menu if it does show!

 

Put your products in here as usual.

 

Using Php MyAdmin, alter the creation dates of the Free gifts in order to remove them from the New Products windows set the Year for last year.

 

Add this code to where ever you wish to link to your free gifts. e.g shopping_cart.php

 

 

 

 

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

 

<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color=red> <a href="http://www.your_site.co.uk/catalog/default.php?cPath=169">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()+35);

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

echo "</font>";

} ?> 

 

 

 

 

The following changes are required to the above code.

 

www.your_site.co.uk/~ - set this to your own site

35 - This is the figure at which the free gift page is activated. This needs setting in two places.

 

default.php may need to be index.php as was my case.

 

cPath=169 - This needs to change to whatever your free category path is. If you have trouble working this out, give it a name and when it appears in the menu, click it and the path will be shown in the address bar. remove Temporary name and its hidden again!

 

Enjoy.

 

Thanks!

Justin

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...