Author |
Topic |
|
keng
VP-CART New User
152 Posts |
Posted - September 10 2004 : 16:49:55
|
Hello,
I need to make an exception code in line 130 of shopdisplayproducts.asp. On this line you can find the code "error shopwriteerror getlang("langProductSearch")" - this code displays the error message, "No Products Match your Search" when you have no products listed in a category.
My problem is: How do I make an exception code so that when a customer select Category #10, the "No products match your search" message does not get generated or come out of the page?
For example:
Normally, if you have a category called "Clothes" you would have Green, red, blue etc. as your products. But with my case, I consider Gift Registry and Gift Certificates as my "Other" Category. Since Gift Registry/Certificate do not really have any product(s) underneath it, it always displays a message "No Product Match your Search" at the bottom. To resolve this, I need to get rid of this error message specific only to this category. Please Help!
Edited by - keng on September 11 2004 23:46:15 |
|
CHAVOUSA
VP-CART New User
USA
86 Posts |
Posted - September 13 2004 : 11:36:45
|
Just so that others and myself are clear...what is your reasoning to have the category by itself without anything inside that category? Maybe there are other options for what you are looking to do...please elaborate.
|
|
|
keng
VP-CART New User
152 Posts |
Posted - September 13 2004 : 16:28:24
|
Thanks CHAVOUSA...
I will elaborate more.... My online retail store has categories called Top, Bottoms, Dresses and "Others". "Others" category contains a page that has a link to the Gift Registry and Gift Certificate. I consider Gift Registry/Certificate as "other" things to do in my shop.
Now, when users go to my shop and click on my "Other" category, they get redirected to this page I created that contains the links to Gift registry and certificate which work. There is no problem on this page. It works and looks just how I want it to be -except- that at the bottom there's a "No Products Match your search" message.
I emailed VPASP and they said that I need to modify my shopdisplayproducts.asp in line 130, make an exception code so that when a customer clicks on the "others" category, "error shopwriteerror getlang("langProductSearch")" won't apply or generate a message of "No Products match your search" message.
Your help is greatly appreciated. Thanks!
|
|
|
jonmadrid
VP-CART New User
USA
192 Posts |
Posted - September 16 2004 : 11:55:27
|
Hi keng,
While there may be other options for you to achieve your goal, as CHAVOUSA suggested, if you want to go with the route you have described, I think the following code should do the trick for you:
In shopdisplayproducts.asp, around line 130, where it says:
******* shopwriteerror getlang("langProductSearch") *******
Simply replace it with this:
******* If cat_Id <> 1 Then shopwriteerror getlang("langProductSearch") End If *******
That just tells it to ONLY show the error message if the category being viewed is NOT the one you want to give an exception to.
A couple things to note:
1) Just place the category id for the category you want to give an exception to where it currently has the number 1. If there are more than one categories you want to grant exceptions to, the code would look like this:
******* If (cat_Id <> 1) OR (cat_Id <> 2) Then shopwriteerror getlang("langProductSearch") End If *******
I'm sure you can see the pattern there of just adding variations for possible categories to exclude.
3) The cat_Id variable will have already been "cleansed" of possible malicious code when it's used here so there is no need to worry about someone trying to exploit this moddification in that manner.
4) I haven't tested this code. It should work but if it doesn't just let me know.
That's it. Pretty easy, huh?
I hope that helps.
All the best,
Jon Madrid -------------------- Madrid Communications Web Design, Development, and Hosting www.madridcom.com
|
|
|
keng
VP-CART New User
152 Posts |
Posted - September 16 2004 : 17:54:11
|
OMG! It works!!!!!! Thanks soooooooooooooo much, Jon!
|
|
|
jonmadrid
VP-CART New User
USA
192 Posts |
Posted - September 16 2004 : 18:26:01
|
No problem. Glad I could be of help.
All the best,
Jon Madrid -------------------- Madrid Communications Web Design, Development, and Hosting www.madridcom.com
|
|
|
|
Topic |
|