Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 New Way of Having A Gift Wrap Option
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Steve2507
VP-CART Expert

590 Posts

Posted - September 30 2010 :  08:19:21  Show Profile  Reply with Quote
Thought you may like an alternative way of adding a gift wrapping option to your sites. We have been looking at doing this for some time but the methods in VP didn't relate to how we wanted it to work. So here's the method we came up with, hope it is of some use to others.

Background
We wanted a way in which customers could have gift wrapping for their entire order, but without having to add it on every product. Neither did we want it as another product which customers may or may not find. We wanted it to show up as an optional extra when the cart was viewed (shopaddtocart.asp). We also didn’t want to annoy customers who had already added it to their basket. So it was only to show if it wasn’t in the basket, then when it had been added to the basket the option wasn’t to be shown.

Create a new product for gift wrapping, along with its own extended view template.

That’s the easy bit over with.

Create html code which will go under the cart display (we essentially did a slimmed down version of the product template). This will link to the expanded view of the gift wrap, which is where the customer adds their message.

In shopaddtocart.asp declare a new variable at the top of the file
dim cartcatalogid

In Sub FormatFormFields wherever you want your html code to go enter this:
If cartcatalogid <> ##### then
%>
YOUR CODE
<%
end if

Where ##### is the catalogid of the gift wrap product.

Then to pull in the cartcatalogid variable open up shopcartformat.asp and find Sub CartFormatProducts make a copy of this sub and call it CartFormatProducts_Mine. If you don’t do this then the system will work, but your customers won’t be able to go to shopcreateorder.asp which effectively renders your shop dead (painful lesson for 60 minutes learnt).

In the new sub (Sub CartFormatProducts_Mine) find
cartfields=arrCart(cProductname,i)

and after it enter
catalogid=arrCart(cProductid,i)
  If cartcatalogid <> 14415 then  
cartcatalogid=catalogid
end if

Now you need to reference the new CartFormatProducts_Mine on the shopaddtocart.asp file but not in any other file. So in shopcartformat.asp find Sub CartFormat (AllowDelete) and in this sub find
CartFormatProducts

Replace it with
if instr(lcase(request.ServerVariables("SCRIPT_NAME")), "shopaddtocart.asp") > 0 then
   CartFormatProducts_Mine
Else
	CartFormatProducts
end if

Upload your files and you’re done.

Please remember to back up the original files first though my mistake meant our site was down for 60 minutes and I hadn’t done a back up, so over dinner (wife wasn’t too happy) I had to work to fix it.

Hope this help someone out there. There are probably other ways of doing this and my code may be a little shoddy but hey, it works.


Steve
Sex toys from a UK sex shop including vibrators and dildos.

Edited by - Steve2507 on September 30 2010 08:22:08
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00