Print Page | Close Window

Conditional images based on category

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=1014
Printed Date: 21-April-2025 at 12:07pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Conditional images based on category
Posted By: thrion
Subject: Conditional images based on category
Date Posted: 05-August-2007 at 7:19pm
We are selling via google checkout, and google has asked us to display a particular graphic on the page of some items based on the product category.

We are using the viewprdL.asp page and want to add some asp code that will conditionally display the google image, but it's not quite working right.  Could someone take a look at this code snipet and help me figure out what I did wrong?

We are placing the code right after:

<!-- End Quantity and Add to Cart -->


and the code we wrote is:

<% ' If google asks show this image
        if pcIDCategory in (32, 33) then %>
        <td>
        <img src="http://checkout.google.com/buttons/checkout.gif?merchan t_id=234782597607506&w=180&h=46&style=white& variant=disabled&loc=en_US">
        </td>
<%     end if %>


Thanks in advance for any help!



Replies:
Posted By: netprofits
Date Posted: 06-August-2007 at 9:02am

The line:
if pcIDCategory in (32, 33) then
is not valid vbscript. It is closer to an SQL statement.

Use something like this:
If InStr("32,33",cStr(pcIDCategory)) Then

If you need help with ASP and VBScript, Javascript, etc. check out:
http://www.w3schools.com/vbscript/ - http://www.w3schools.com/vbscript/



-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net