PDA

View Full Version : Adding products Automatically


simonbridges
22-Apr-2003, 11:50 AM
Is it possible to add a 'free' product to an order automatically, if that order matches certain criteria eg:

Spend £50 on prints and get a free calendar.

many thanks

Simon
http://www.alexreade.net

cdicken
23-Apr-2003, 08:55 AM
Not at the moment, but we are looking at this for a future release.

If you just want a bit of code to appear (e.g. containing link to a free product) based on the total value of items in the cart, or the number of items in the cart, then here is some JavaScript to use:

http://community.actinic.com/showthread.php?s=&threadid=1060

simonbridges
23-Apr-2003, 03:22 PM
thanks Chris, I will keep an eye on future releases. Cheers for the code

Simon

Mike Hughes
24-Apr-2003, 08:10 AM
Chris,

that thread appears to be in the developers forum that we don't all have access to. (At least I can't see it).

Can you either replicate this or move it to the knowledge base.

Thanks

Mike

Nadeem
24-Apr-2003, 09:21 AM
Hi all

Here it is


The only thing I can think of is having a JavaScript expression that acts on the 'Items' value in the shopping cart summary and displays a message accordingly.

This would act on all products though rather than a distinct sub-set.

I have knocked up a very quick and dirty sample code (based on the stock level example in the AUG) which does this:

Put this into the <HEAD> section of your Act_Primary.html template below any other JavaScript you have in there...

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
function FreeGift(pItem)
<!--
{
var strIDs = ''
{
if (pItem >= 20)
{
strIDs = 'You have qualified for a free gift!'
}
else
{
strIDs = ''
}
}
return strIDs
}
//-->
</script>

Insert this code where you want the message to appear....

<script language="Javascript">
document.write(FreeGift(getCartItem(3)))
</script>



Hope it helps