Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Add-ons for VP-ASP
 Need help with Function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

femsawyer
Starting Member

39 Posts

Posted - August 13 2008 :  15:33:46  Show Profile  Visit femsawyer's Homepage  Reply with Quote
I already have a couple of custom fields added to my product setup page, but I'm in need of having a few check boxes as well.

Basically, I need a field labeled "Product is a Digital Download" and then a check box.

Then I want to setup a function that I can call on my tmp_product.htm page. Where if Product is a Digital Download is checked, then it will output a line of text like "This is a downloadable product - no product will be shipped" above [SPECIAL_ORDERBUTTON]. We sell both downloadable products as well as shippable products, so I think this will alert customers who are thinking that the product they are ordering will be shipped when it's actually just a downloadable product. (ie. fewer canceled/refunded orders)

I'm hoping that someone can help walk me through this as I need help with both steps 1) setting up the checkboxes and 2) writing the function (where to put the actual function and how to call it on the tmp_product.htm file)

Thanks in advance.

Partner/Designer: www.3Scrapateers.com
Digital Scrapbooking - Preserve your Memories!

Edited by - femsawyer on August 28 2008 18:52:10

jimbabwe
Starting Member

12 Posts

Posted - August 13 2008 :  17:37:41  Show Profile  Visit jimbabwe's Homepage  Reply with Quote
I would suggest making the check boxes product features. There is plenty of information in the documentation about how to do that.

To do the little pop up notification you'd want to use javascript. Namely the innerhtml function. You'll want to edit the shopproductfeaturesgenerate.asp file and move the javascript in there.

Basically when I have any obscure rules for a single product I'll edit it like that and say (pseudocode),

if catalog id = [insertcatalogidhere] then
output checkbox with javascript attached
else
output normal checkbox
end if

if you have any other questions (please no code syntax questions) you can find a mail form on my website and I'll give you a hand. A
Go to Top of Page

femsawyer
Starting Member

39 Posts

Posted - August 13 2008 :  17:57:25  Show Profile  Visit femsawyer's Homepage  Reply with Quote
thank you for replying. I think I may not have explained myself clearly.

I'm not looking for any sort of popup. I need a checkbox on my product add/update page in the admin. This isn't anything our customers would see - only our suppliers.

Then I want to call a function where when a customer views a product, if it's a downloadable product (the checkbox on the product add/edit page would be checked), there would be a message above the Qty/Order button. Nothing popping up. Just a "if the product is checked as being a download - display this message", if it's not a downloadable product, don't display the message.

Partner/Designer: www.3Scrapateers.com
Digital Scrapbooking - Preserve your Memories!
Go to Top of Page

femsawyer
Starting Member

39 Posts

Posted - August 19 2008 :  08:01:06  Show Profile  Visit femsawyer's Homepage  Reply with Quote
Ok. Well, if I can't add a checkbox to my product setup page, can someone help me with the function that I would put in shop$db. I'll just have to use a custom text field in the product setup and have the suppliers input the word "yes" for digital products.

So can anyone help me out with the function to check if the product has yes in that particular field and if so, display a line of HTML code? If it's null, don't display anything.

Any help would be appreciated

Partner/Designer: www.3Scrapateers.com
Digital Scrapbooking - Preserve your Memories!
Go to Top of Page

femsawyer
Starting Member

39 Posts

Posted - August 22 2008 :  23:36:37  Show Profile  Visit femsawyer's Homepage  Reply with Quote
Sorry to bump this but I'm really hoping that someone can help me out with the function that I need. I've given it a couple of days hoping that someone would help.

I'm begging here...lol.

Partner/Designer: www.3Scrapateers.com
Digital Scrapbooking - Preserve your Memories!
Go to Top of Page

femsawyer
Starting Member

39 Posts

Posted - August 28 2008 :  11:25:39  Show Profile  Visit femsawyer's Homepage  Reply with Quote
OK. Because I'm desperate here and I haven't received any help, I've tried to come up with this on my own - however, I'm still wanting some help here.
What I've done is create a new field in my products table (virtual). I've added the field in the shop setup so it's now showing on the product setup page. Basically, my product page asks Virtual Product - yes or no.

Now, I DO NOT know asp but I've looked at a couple of other subs and tried to come up with the code for it. Here's what I have so far.

Sub virtualproduct
if virtual = "yes" then
	Response.write "This product is a digital download.  No product will be shipped."
	end if
end sub



So now a few questions:

1. Will my code above work and if not, can you help me out with it?
2. What file and where do I put the above code?
3. How do I call this on my tmp_productformat.htm?

I would really appreciate some help on this.

Partner/Designer: www.3Scrapateers.com
Digital Scrapbooking - Preserve your Memories!
Go to Top of Page

jimbabwe
Starting Member

12 Posts

Posted - October 16 2008 :  13:26:40  Show Profile  Visit jimbabwe's Homepage  Reply with Quote
Sorry it's been so long haven't been back to the forums since I posted last. I didn't really understand what you were asking it seems and I gave wildly incorrect advice. What you're wanting to do would be very easily done with the templating engine.

You can use any field you want(in the products table) to store whatever information/html you want. Then on your template you'd put this line

$ <p>[columname]</p>

Make sure the $ is the first character on in the row and it will only display that row of text if there is data inside 'columname'. You can do multiple lines of html like this as well, and you can store more html in the database field if you like too.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00