Print Page | Close Window

Custom Search Fields

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Using ProductCart
Forum Description: Running your store with ProductCart
URL: https://forum.productcart.com/forum_posts.asp?TID=4938
Printed Date: 09-March-2025 at 12:38am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Custom Search Fields
Posted By: lhuggins
Subject: Custom Search Fields
Date Posted: 11-January-2012 at 12:54pm
Is there a way to assign an item to more than one value in a custom search field? 
Example;
Search field- Drum type
                        Values- Metal drum
                                    Plastic drum

I have a product that can be used on metal and/or plastic. If I assign it to metal drum it will not show up on a plastic drum search, if I assign it to plastic drum it will not show up on a metal drum search. I have tried to clone it and assign one to metal and one to plastic but when there is no search on drum type they both show up.



Replies:
Posted By: Hamish
Date Posted: 21-January-2012 at 3:42pm
Hi,  
   Custom Search Fields only support a single value for each product I'm afraid.


-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: lhuggins
Date Posted: 21-January-2012 at 4:15pm
Any ideas on a work around? I have many products that this effects.


Posted By: p00pstar
Date Posted: 02-March-2012 at 2:41am
There is a workaround. 

1. From "pcadmin" open file "modifyProductB.asp";
2. Search for "function AddSF(tmpSFID,tmpSFName,tmpSVID,tmpSValue,tmpSOrder)";
3. Change the javascript function to this :

function AddSF(tmpSFID,tmpSFName,tmpSVID,tmpSValue,tmpSOrder)
{
    if (tmpSValue!="")
    {
        var i=0;
        var found=0;

        SFCount++;
        SFID[SFCount]=tmpSFID;
        SFNAME[SFCount]=tmpSFName;
        SFVID[SFCount]=tmpSVID;
        SFVALUE[SFCount]=tmpSValue;
        SFVORDER[SFCount]=tmpSOrder;

        CreateTable();
    }
}

Now it will work to add more values to the same custom-field. Otherwise, it will just replace the old value...



-------------
www.dotdesignmedia.ro // web application development


Posted By: lhuggins
Date Posted: 05-March-2012 at 3:03pm
Thank you so much for this GREAT information, I really need a work around. One problem, I can not find "function AddSF(tmpSFID,tmpSFName,tmpSVID,tmpSValue,tmpSOrder)" in "modifyProductB.asp".

I am using PC v4.5bcm


Posted By: lhuggins
Date Posted: 05-March-2012 at 3:25pm
I did find it in "modifyProduct.asp" and changed it as you instructed and I can not add more than one value to one custom search field.


Posted By: Hamish
Date Posted: 05-March-2012 at 3:25pm
Hi, Try in modifyproduct.asp. The code also appears in several other files.

-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: p00pstar
Date Posted: 05-March-2012 at 3:43pm
I'm afraid i can't help you with 4.5, i only have version 4.1 with sp3.
Maybe there are some differences, i don't know...


-------------
www.dotdesignmedia.ro // web application development


Posted By: p00pstar
Date Posted: 05-March-2012 at 3:47pm
This function just searches for the custom field that you want to modify, and if it exists, it replaces the old value with the new value. 

If you comment those lines (or delete them) it will work to add another value to the same custom field...


-------------
www.dotdesignmedia.ro // web application development


Posted By: lhuggins
Date Posted: 05-March-2012 at 6:48pm
Thank you for the help, unfortunately it did not work. I modified "modifyProduct.asp" to;
function AddSF(tmpSFID,tmpSFName,tmpSVID,tmpSValue,tmpSOrder)
{
if (tmpSValue!="")
{
var i=0;
var found=0;
SFCount++;
SFID[SFCount]=tmpSFID;
SFNAME[SFCount]=tmpSFName;
SFVID[SFCount]=tmpSVID;
SFVALUE[SFCount]=tmpSValue;
SFVORDER[SFCount]=tmpSOrder;
}
CreateTable();
}
}
And it still replaces the value in custom fields instead of adding another one.


Posted By: p00pstar
Date Posted: 06-March-2012 at 3:23am
function AddSF(tmpSFID,tmpSFName,tmpSVID,tmpSValue,tmpSOrder)
{
    if (tmpSValue!="")
    {
        var i=0;
        var found=0;
        SFCount++;
        SFID[SFCount]=tmpSFID;
        SFNAME[SFCount]=tmpSFName;
        SFVID[SFCount]=tmpSVID;
        SFVALUE[SFCount]=tmpSValue;
        SFVORDER[SFCount]=tmpSOrder;
        CreateTable();
    }
}

Put it like this and pay attention to the { } blocks, maybe that's why it didn't work...


-------------
www.dotdesignmedia.ro // web application development


Posted By: lhuggins
Date Posted: 06-March-2012 at 2:15pm
I really appreciate your work in this, it is a MAJOR issue with our business. I tried again and still the same results, when I put a different value in a search field the old value is replaced, below is a copy of the code (I copied and pasted what you provided).

function AddSF(tmpSFID,tmpSFName,tmpSVID,tmpSValue,tmpSOrder)
{
    if (tmpSValue!="")
    {
        var i=0;
        var found=0;
        SFCount++;
        SFID[SFCount]=tmpSFID;
        SFNAME[SFCount]=tmpSFName;
        SFVID[SFCount]=tmpSVID;
        SFVALUE[SFCount]=tmpSValue;
        SFVORDER[SFCount]=tmpSOrder;
        CreateTable();
    }
}



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