View Single Post
  #6  
Old 08-18-2006, 07:10 AM
 
QVS QVS is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 136
 

Default Re: Automatically adding free items

Quote:
Originally Posted by Nancy
I had the same situation you had. I wanted to automatically add free items to each user's shopping cart. I am running version 4.0.12. Here is the reply I got from tech support. Hope it helps.

Please perform following steps :

1. Open '<xcart_root_dir>/cart.php' file.

2. Replace :

Code:
--- } elseif($from == 'partner' && $productid) { func_header_location($xcart_catalogs['customer']."/product.php?productid= ".$productid); } } # # DELETE PRODUCT FROM THE CART # ---
with

Code:
--- } elseif($from == 'partner' && $productid) { func_header_location($xcart_catalogs['customer']."/product.php?productid= ".$productid); } if ($productid<>%ID%) func_header_location($xcart_catalogs['customer']."/cart.php?mode=add&productid= %ID%&amount=1"); } # # DELETE PRODUCT FROM THE CART # ---
Just replace %ID% with the ID of 'free' product.
For example :

--
if ($productid<>16126)
func_header_location($xcart_catalogs['customer']."/cart.php?mode=add&productid= 16126&amount=1");
--
--


Im trying to get this working on 4.0.14 and its not adding the item to the cart and causing the cart to freeze at points, does anyone know what the updated code would be for my version, thanks in advance.
__________________
xcart version 4.1.6
UK - Brighton

QVS ELECTRICAL SUPPLIES - http://www.qvsdirect.com

We supply a huge range of cables, electrical accessories, heating, ventilation, fire and security products, consumer units & circuit distribution, indoor and outdoor lighting, showers and water heating, tools and fixings, timer switches, sockets, switches, air conditioning, trunking, and much much more.
Reply With Quote