PDA

View Full Version : Product References and Images on Search Results Page


ditch
13-Jan-2003, 11:37 PM
Hi,

I'm trying to put the product reference and thumbnail of the product image onto the search results page.

Thanks to our good friend Norman Rouxel, I have found a patch to add images.

However, product references are really important to our customers. We have lots of products with similar descriptions and prices but completely different part numbers and images.

If this information was found on the search results page, our site would be much easier to use.

Any ideas? I've already rang the techies, but thought I'd ask here to see if I could get a few suggestions

NormanRouxel
14-Jan-2003, 01:53 AM
Here's a patch to my patch that will add in the Product Reference.

In the patched Act_ResultsTemplate.html

Change the line

<Actinic:S_IMAGE/><Actinic:S_ITEM/>.

to read

<Actinic:S_REFNUM/> <Actinic:S_IMAGE/><Actinic:S_ITEM/>.

And in the patched SearchScript.pl (V5 & V6 versions)

locate the line (there should be only one instance)


$ACTINIC::B2B->SetXML('S_IMAGE', $NorcatImage);


and immdiately above it ADD the line:


$ACTINIC::B2B->SetXML('S_REFNUM', $NorcatRef);

Now I'm pretty sure this will work but I've not tested it so proceed with care.

You may want to add some spacing or move the <Actinic:S_REFNUM/> fragment around in the patched Act_ResultsTemplate.html.

Norman.

p.s. I don't actually use any of these patches myself so please let me know your URL when you have it up and running so I can take a peek.

ditch
14-Jan-2003, 09:21 AM
Thanks very much norman.

You can have a look at the working search patches at our web site http://www.macleanmarine.com.

Some of the product images do not display in the search results even though there is a product image. Any suggestions of how to rectify this problem?

thanks again
Richard :D

ditch
14-Jan-2003, 10:55 AM
In fact, most of the images don't display! :confused:

NormanRouxel
14-Jan-2003, 10:59 AM
Hey - nice to see these patches in use. That was quick getting the refernce numbers up and running.

The reason some images don't show is that you've got the same product in more than one section and have added a "-" to the product reference to keep it unique, but are using the original imagename without the "-". As the patch looks for a filename "refnum.gif" it's looking for (say) "-65257,gif" when there's only a "65257.gif" there.

You can fix this by making a copy of the graphic with the same name as the additional product whenever you create a duplicate and using that in the product dialogue.

Or if you're feeing brave you can do this:-
in the patched SearchScript.pl find the line

my $NorcatRef = $$rarrResults[$nCount];

and ADD this line immediately after it

$NorcatRef =~ s/^-+//; # strip any leading "-" characters

this will strip any leading "-", or "--", etc, from your product reference before using it to look for the image names, this will have the minor side effect of not showing the "-" bits on the search results page.

Norman

p.s. You can also show them on the shopping cart. Details of that and lots of other patches are on www.rouxel.cwc.net/actinicstuff.html

ditch
14-Jan-2003, 01:12 PM
Hi Norman,

You are a wizzkid!

I've put the extra bit of code into the searchscript file but it doesn't want to work for some reason. I haven't tried a site refresh yet though.

In the case of a product reference with / in it, would the above code strip these out and search just for the numbers and letters.

For example: a KD505/2 would display kd5052.gif


cheers

Rich

NormanRouxel
14-Jan-2003, 01:45 PM
Are you saying that your main product references are always numeric? If so I'll send a patch that would strip out everything but numbers. Your example is a little tricky as you'd have to decide which number (before or after the / is relevant). Let me know whan you have a well defined idea.

Norman

ditch
14-Jan-2003, 02:45 PM
Our product codes are a mixture of letters and numbers usually

Let me describe an example

We sell a light fitting with product code BRIM118, but it comes in three options so we have three seperate product codes

BRIM218/ER/16
BRIM218/ER/25
BRIM218/ER/26

If the search script pulls up the image for this code it will look for BRIM218/ER/16.jpg, so the image would have to be called 16.jpg and put into a directory called ER and then a directory called BRIM218. Are you with me?

This would be fine, except there are over 3000 products on the site and that would mean a lot of work and a lot of wasted space.

I was hoping that the code you gave me to strip out the ("-") would solve the problem but alas, no luck as yet.

NormanRouxel
14-Jan-2003, 02:56 PM
First you'd have to have product codes where all characters are valid in filenames. So "/" would have to be replaced with (say) "-". You can use Actinic's Edit / Find command to locate all products containing a "/" in the reference number.

Also in the example you gave above would that be three products with different images or the same image for all 3?

Then you'd have to have a well defined system for dealing with products in more than one section. having them begin with "-" (repeated if necessary) is fine.

The tiny patch for to strip the leading "-"'s should have started working after a site update. Perhaps I got the Perl wrong, although it looks OK to me.

Norman

ditch
14-Jan-2003, 03:25 PM
I agree that would solve the problem but our staff and our computers would not recognise the code without the '/'.

Is it possible to add a further search string. Whereas if the image isn't found for productref.gif or productref.jpg, the section image would be displayed?

I'm not really sure how to do that myself, I'm guessing it's complicated but I'm willing to have a go!

Rich.

NormanRouxel
14-Jan-2003, 06:51 PM
Leave the code as you expect it with the /'s in it. You have compelling reasons. How about replacing all "/" and any other funny characters with "-" for the image filename only and have the search patch look for that.

I.e. For product BRIM218/ER/16 you would save it's image with name BRIM218-ER-16.gif (or jpg) and all would work.

The patch I mentioned earlier would become:-

Look for

my $NorcatRef = $$rarrResults[$nCount];

and ADD these 2 line immediately after it

$NorcatRef =~ s/^-+//; # strip any leading "-" characters
$NorcatRef =~ s/\//-/g; # replace "/" with"-"



Norman

ditch
19-Jan-2003, 07:33 PM
I've got it working to a stage I'm happy with now. I'm sure it will get better as our site grows.

Thanks very much for your help norman.

NormanRouxel
19-Jan-2003, 08:57 PM
A final tweak. In your patched SearchScript.pl
locate the line (there should be only one instance)


$ACTINIC::B2B->SetXML('S_REFNUM', $NorcatRef);


and change it to read


$ACTINIC::B2B->SetXML('S_REFNUM', $$rarrResults[$nCount]);

This will ensure that the reference numbers displayed in your search results are the true numbers (with the "/" still in them).

Norman

thedjbox.com
20-Jan-2003, 11:26 AM
What about going one step further and putting an add to cart button on the search results.

This would be very usefull as I use the search script for navigation around my site.

Thanks


Neil Westlake
theDJBox.com

NormanRouxel
20-Jan-2003, 05:57 PM
Now while I always like a challenge that one might be a bit tricky.

It shouldn't be too much trouble to deal with a simple product containing no options and bung in an Add button. However the product might also requires all the coding for Other info Prompts, Date Prompts, Attributes and Choices.

Norman

thedjbox.com
20-Jan-2003, 06:58 PM
Norman,

That would be spot on, most of the products on my site don't have options so a simple add to cart button on the search page would be superb.

Thanks


Neil Westlake
theDJBox.com

harlequin
21-Jan-2003, 02:13 AM
Come on Actinic, give Norman some help here, he has a life to lead as well you know.

I am desperate for the search results to have an add to cart button and again its this 'make things more efficient as we grow' scenario, things like this can make a huge difference on sites getting 20,000 visits a day...

The client I am thinking of in particular uses the product images in search results patch at the moment and this alone has far and away proven to have increased their orders/quality of enquiries/bandwidth usage etc..... their next logical stage is to reduce one of those magical and much talked about risky 'extra clicks' on your way to a purchase by having an add to cart button there.

Also, for the images in search results it would be far better if Actinic just integrated the feature and made it so the images didnt nescessarily have to be named exactly the same as the product reference.

They dont have to be the same on the product pages so am I asing too much that the products listed on the search results use the images as if they were on a product page ?? (And all the other data from that product,info prompts, choices etc.. IF you as webmaster CHOOSE to include it maybe from the View>Search Settings bit in Actinic the program?)

Im all for customising our clients sites to achieve these features as it earns us money however I cannot understand why this knowledge which has been around since Version 4 cannot be implemented as standard and we can all move on to the next new thing without having to reapply several perl patches to each customised site each time an upgrade patch is released or even just waste days repeating the same processes each time we build a new site.

Just my tuppence worth but I am sure I will repeat the request again until I get my way...or Norman sorts it ;)...again.

cdicken
22-Jan-2003, 11:11 AM
Both these features (images and add to cart buttons in the search results) are in the Wish List.

That's all I can say at teh moment except to thank Norman for all his helpful work in this area.

harlequin
22-Jan-2003, 11:18 AM
been on the wish list since version 4 ;)

musiccorner
23-Jan-2003, 09:08 PM
Originally posted by ditch
Thanks to our good friend Norman Rouxel, I have found a patch to add images.

Hi Richard

I've entered this one late so far I follow the patched patch to add part numbers.

But where did you find this first patch to add images, then I'll get to the part numbers....

All in all a smart idea. Add to cart, it's as good as sold

harlequin
23-Jan-2003, 11:37 PM
Hi Chris,

http://community.actinic.com/showthread.php?s=&threadid=217

musiccorner
24-Jan-2003, 08:16 AM
Thank you Steve (again)

I'll have a go late on tonight, do you think I can do it...?
;)

harlequin
24-Jan-2003, 09:26 AM
Hi Chris, norman has detailed the various patches with great instructions and you should have no problem with them.

As ever take a snapshot of your current site.

The nice thing when you do the search images in results patch and upload the changes to test, it only uploads some cgi files and the results.html page meaning you can quickly test if it works, and if not quickly change it back. (It doesnt need to upload the whole catalog unless you have also changed image filenames to match the product reference, then it will upload the images as well...)

Let us all know how you go, its a very nice step to be taking this on yourself and a testament to Normans hacks/plugins ease of use.

PS. I hope I dont sound too sychophantic about Norman, but credit where its due and all that.....

ditch
24-Jan-2003, 06:04 PM
Sorry I've not checked the community for a while, didn't see your questions until today musiccorner.

I've uploaded the additional tweak to the perl you suggested.

Thanks again for your help. I've actually seen an increase in customer orders since implimenting the new search patches you provided norman. So thanks a bunch, the boss is pleased!

-----

Now this add to cart button in the search results is an interesting idea! I can see the problems with it, you mentioned earlier norman, products with options would be tricky.

The best thing to do would be to have the script not put add to cart buttons of products with options, and only put the button on the products which are simple.

musiccorner
24-Jan-2003, 11:10 PM
Steve When you say you have also changed image filenames to match the product reference

can i put the part name as the image name say....7155sm or does it need to be 7155sm.jpg which is the name of the image?

May sound a bit thick but I'm still new to this code stuff!

Anyway I've done something wrong!?! :confused:

NormanRouxel
25-Jan-2003, 12:13 AM
You use just the part name for your product. I.e. "7155sm" and then your image should be named "7155sm.jpg" or "7155sm.gif". Without the quotes of course.

Norman

musiccorner
25-Jan-2003, 08:47 AM
Thanks Norman

I'll try again. It's probably something real simple I've done wrong; but I'll probably be back soon...

...another weekend another time to mess....!

musiccorner
25-Jan-2003, 10:45 AM
Hi again.

I managed to get it sorted, I feel good.

Just got to change nealy 200 part numbers and image paths now. What fun...it will keep busy for a while.

Thanks you Norman and Steve, I've reached achieved another learning marker.

:D

NormanRouxel
25-Jan-2003, 10:51 AM
Just a reminder. Somewhere up this thread it was pointed out that "/" characters in the product reference would be a pain if they were to be included in the image name. Also a method was required to have a product in more than one section but use the same image.

I've rejigged the patches to fix this. Here are the notes re the new bits:-

As the character "/" may occur in product references but will be a problem on the web the "/" character will be replaced by "-" so the product reference "XYZ/123" should have XYZ-123.jpg or XYZ-123.gif as its image name.

To allow you to put a product in more than one section (where it must have a different product reference) you can use one or more "-" as a prefix to the product reference and all these will be stripped out when checking for the image. E.g. product "XYZ-123" can be also called "-XYZ-123" or "--XYZ-123", etc but all of them will use the image named "XYZ-123.jpg".

The new patches are on www.rouxel.cwc.net/actinicstuff.html

Norman

musiccorner
27-Jan-2003, 07:53 PM
Hello Norman,

Sorry about a little more on these patches. I have it working on my site www.musiccorner.co.uk/acatalog (http://) for Melodeon or Accordion.

I've aligned the pictures at 1/3rd to the left of text.

I wondered if there is anyway of hyperlinking the picture according to the line and text.

What is happening is that the picture is linking to the next line of text, as the others are. So the picture is always one link down.

The search page links seem to go text of 1 and number 2, text of 2 and number 3 etc... With the pictures in it ignores picture number one as a link and then takes text of 1, picture number 2, next line numeral 2. Text of 2, picture 3, next line numeral 3.

Does this make sense I'm getting muddled typing it? You'll see it better here (http://www.musiccorner.co.uk/cgi-bin/ss000001.pl?SS=melodeon&PR=-1&TB=A&SHOP=)

Can this be modified / included on the script. I feel it could get a bit confusing for some customers.....cliking on a picture and finding themselves else where...

(I havn't made the patch for the /'s yet...decided I didn't need them as yet.)

However the effect is great and I feel wil help a great deal when I get all the background work done.

NormanRouxel
27-Jan-2003, 09:44 PM
I think you've munged your Act_ResultsTemplate.html - the image should be outside the links if you followed my HOWTO. Could you please post (or attach it here).

BTW if you want to see a nice implementation of this see http://www.macleanmarine.com/ and search for e.g. brass and you'll see it working OK.

Norman

musiccorner
27-Jan-2003, 09:58 PM
Hi

second attempt, wouldn't take the attachment.

The marine site is great. I like the box with a that info in. I'll bet that's complicated. The lining up and everything. It is so used friendly. I am aiming towards this. Gotta start somewhere.

The HTML template

<!-- Results HTML begin -->
<!-- Add Results Page header HTML here -->
<div align="center">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=10 WIDTH="500" ALIGN="CENTER">
<TR>
<TD ALIGN=LEFT> <B><Actinic:S_SUMMARY/></B><BR>
<Actinic:S_CONTINUE/> </TD>
</TR>
<TR>
<TD ALIGN=LEFT> <Actinic:SEARCH_RESULTS> <Actinic:S_IMAGE/><Actinic:S_ITEM/>. <Actinic:S_LINK/><B><Actinic:S_PNAME/></B>
<Actinic:S_SNAME/> <Actinic:S_PRICE/> <BR>
<Actinic:S_DESCR/><BR>
<Actinic:S_PROP/>
<P>
</Actinic:SEARCH_RESULTS> </TD>
</TR>
<TR>
<TD ALIGN=LEFT> <B><Actinic:S_SUMMARY/></B><BR>
<Actinic:S_CONTINUE/> </TD>
</TR>
</TABLE>
<!-- Add Results Page footer HTML here -->
NETQUOTEVAR:SEARCHBLOCK
<!-- Results HTML end -->
</div>

Is that allright? Can I do that on here?: :)

NormanRouxel
27-Jan-2003, 11:04 PM
Attaching the file is better as the forum loses all the spacing that makes it more readable. The </a> tag was missing.

Here's it corrected and with the image now part of the link.


<!-- Results HTML begin -->
<!-- Add Results Page header HTML here -->
<div align="center">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=10 WIDTH="500" ALIGN="CENTER">
<TR>
<TD ALIGN=LEFT> <B><Actinic:S_SUMMARY/></B><BR>
<Actinic:S_CONTINUE/> </TD>
</TR>
<TR>
<TD ALIGN=LEFT> <Actinic:SEARCH_RESULTS><Actinic:S_LINK/><Actinic:S_IMAGE/><Actinic:S_ITEM/>. <B><Actinic:S_PNAME/></B></a>
<Actinic:S_SNAME/> <Actinic:S_PRICE/> <BR>
<Actinic:S_DESCR/><BR>
<Actinic:S_PROP/>
<P>
</Actinic:SEARCH_RESULTS> </TD>
</TR>
<TR>
<TD ALIGN=LEFT> <B><Actinic:S_SUMMARY/></B><BR>
<Actinic:S_CONTINUE/> </TD>
</TR>
</TABLE>
<!-- Add Results Page footer HTML here -->
NETQUOTEVAR:SEARCHBLOCK
<!-- Results HTML end -->
</div>


Everything between "<Actinic:S_LINK/>" and "</a>" above will be clickable. You can move these about but they must stay between the "<Actinic:SEARCH_RESULTS>" and "</Actinic:SEARCH_RESULTS>" tags.

Norman

musiccorner
28-Jan-2003, 07:51 AM
Thank you yet again Norman

I did try to attach it but it said you can only attach .gif, .jpeg etc....

One can but try!

I'll upload later. Back to my day job now......mum

I should be quiet for a bit now.,.,.,lots to change.!

musiccorner
28-Jan-2003, 07:51 AM
Thank you yet again Norman

I did try to attach it but it said you can only attach .gif, .jpeg etc....

One can but try!

I'll upload later. Back to my day job now......mum

I should be quiet for a bit now.,.,.,lots to change.!