Announcement

Collapse
No announcement yet.

Product References and Images on Search Results Page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Product References and Images on Search Results Page

    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

    #2
    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.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      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

      Comment


        #4
        In fact, most of the images don't display!

        Comment


          #5
          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
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            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

            Comment


              #7
              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
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                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.

                Comment


                  #9
                  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
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment


                    #10
                    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.

                    Comment


                      #11
                      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
                      Norman - www.drillpine.biz
                      Edinburgh, U K / Bitez, Turkey

                      Comment


                        #12
                        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.

                        Comment


                          #13
                          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
                          Norman - www.drillpine.biz
                          Edinburgh, U K / Bitez, Turkey

                          Comment


                            #14
                            Add to Cart Button

                            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

                            Comment


                              #15
                              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
                              Norman - www.drillpine.biz
                              Edinburgh, U K / Bitez, Turkey

                              Comment

                              Working...
                              X