View Full Version : Search Results Hack
PaulGrimshaw
15-Jul-2007, 09:39 AM
I was going to post this in the KB thread, but thought I would wait until someone else has tested this and maybe refined it...
This HACK allows you to use any variables and layout in your results page. Its not perfect, but until something comes out better, it'll do... and if like me you are only just entering product details its pretty easy! You must not be using your extended info page for anything else and there is a small change in one of the scripts. Note: If the product doesnt have a extended info page or the script can't find the page - it will skip and move on.
I apologise if I make a mistake - it was complicated to do the first time and I may well have forgotton a step. Ask questions and it will prompt me <s>.
You may test this on my site www.madmash.com (http://www.madmash.com) and use the search on the left. CUFFLINKS and BLOCK produce results.
If you can make this better, let us all know.
Paul.
---
If you are happy to carry on, MAKE A FULL BACKUP and then do this:
1. SCRIPT: Open up SearchScript.pl in the actinic folded and find
$ACTINIC::B2B->SetXML('S_ITEM', ($nCount + 1));
and add underneith:
my $sExtendedFilename;
my $sExtendedHTML;
$sExtendedFilename = "../acatalog/ex_";
$sExtendedFilename .= $$rarrResults[$nCount];
$sExtendedFilename .= ".php";
if (-e $sExtendedFilename)
{
open(FH, $sExtendedFilename);
$sExtendedHTML = do { local $/; <FH> };
close(FH);
$ACTINIC::B2B->SetXML('S_PRODREF', $sExtendedHTML);
}
This will not affect any other searches or uses of this file as it looks for a specific field which we will use later.
2. Open up a product and select the product extended info page. You need to name the page ex_???.php whereby the ??? is the product reference (you might want to turn on the ref bit so it is next to the product name). Then add any html you want to the extended info design (this is INLINE html and not a page, so no body or html tags etc). You can use any code or variables you use anywhere else. (you can see the file format above if you want to change it). (Is there a way to pass the extendedinfo page name into the results page?)
3.You shouldnt have extended info links on your pages (if you do, then you either should remove them or stop doing this hack). Because we are not linking to the extended info page, they don't get uploaded so we need to trigger actinic to make them and upload them. I found that doing this works, but there may be a better way and not even sure if this is needed. Somewhere on your products main page, add
<actinic:variable name="ExtendedInformationLinks" />
Then open that up and add this:
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsPopUpPageGenerated%22%20%2f%3e">
<actinic:variable name="ExtendedInfoPageDesign"/>
</actinic:block>
4. Turn off index duplicates and extended info pages in the search options.
5. Open the Search Results page. Move the "SearchResultsList" anywhere outside the form should be outside the form. Then within "SearchResultsList" it should be empty bar "SearchResult". Inside "SearchResult" should be this:
<Actinic:S_PRODREF/>
This is what is replaced with the html from the extended info page (and is what supplies the script with the product reference).
Done. Upload and test.
<b>Known Problems:</b>
When you link to the results page, the page skips to the input box in the search so you either have to fix this somehow or move the input box. This isnt a problem for me as I don't use it.
You need to remove the <ACTINIC:SECTION > blob from the add to cart code. Not sure what that does, but it still works for me (maybe it wont work in logged in mode?).
p.s. i used some bits from other people to get this working so thanks to all of those (forget who they are).
gabrielcrowe
16-Jul-2007, 09:27 AM
very clever hack, colour me impressed.
uber l33t perl skillz.
Mark H
16-Jul-2007, 09:36 AM
Paul - that is brilliant - on the basis of a quick look I think you have removed the need for duplicates on our new site, and greatly enabled product display cut in different ways - maker, type of product etc etc. Thank you:D :D
Bruce
17-Jul-2007, 08:36 AM
Nice one Paul :cool:.
Regards,
Mark H
13-Oct-2007, 05:14 PM
I really, really want to implement this in V7 - is this easy/difficult?
NormanRouxel
13-Oct-2007, 06:54 PM
You could automate the creation of the helper file by adding some PHP to the Product Layout(s) that automatically writes said file.
It should also be possible to do this without PHP via the AUG article - "Creating Additional Pop-Up Windows".
completerookie
14-Oct-2007, 09:50 AM
paul,
as a sidenote, I went to the site, and initially tried to type into the area called "FIND", it took me a few seconds to realise that although it looked like an input field, iy was in fact a title for the "Find" area
having said that the patch is a good one, thanks
NormanRouxel
14-Oct-2007, 12:39 PM
Updated 08-04-08 (nice date) to simplify code in layout 'Standard Full Search Result' to use the usual layout defined for each product.
Updated 09-05-11 to fix weird Actinic 10.0.4 quirk. Only change to layout Full Search Result.
Updated 29-11-11 to allow for Fragments to be searchable.
Turning the Search Results into a buyable list of products:
This patch allows the Search Results to look like a normal list of product, complete with
cart button, etc.
It works by creating a small text file for each product which is incorporated into the search results.
If you have thousands of products make sure your server can handle that number of extra files.
It's designed for sites using Quantity on Product Page.
It probably won't work with Single Add To Cart pages.
This code is too big for a single post on the Forum so you'll have to do this and the following post.
INSTALLATION
We create an new style of popup page that will write the helper files:-.
Go to Design / Library / Layouts.
Right-click on any of the layout type groups in the 'Layouts' tab and select 'New Layout Type'.
Give it a name of 'Full Search Results' and ensure you select 'Pop-up'.
Click 'OK'.
Right-click on this new layout type group and select 'New Layout'.
Give it a name of 'Standard Full Search Result' and click 'OK'.
Now double-click on this layout to edit it.
Click the 'Edit Layout Details' button.
Change the value in the 'Extended Info Page Filename Field' from:
<Actinic:Variable Name="ExtendedInfoPageName"/>
to:
sr_<actinic:variable name="EncodedProductAnchor"/>.html
Click 'OK'.
This will automatically create a unique filename for each product containing its details.
Now you need to put some layout code into this layout.
In the Edit Layout Code window paste the following (this will use the layout defined for each product or fragment):
<actinic:block if="%3cactinic%3avariable%20name%3d%22ProductType%22%20%2f%3e%20%21%3d%202" ><actinic:variable name="ProductLayout" /></actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22ProductType%22%20%2f%3e%20%3d%3d%202" ><actinic:variable name="FragmentLayout" /></actinic:block>
You can amend this, if required, to use other Product or Fragment Layouts - perhaps use a fixed layout that's a bit more concise.
You now need to create a layout selector to include the new 'Full Search Results' into the store design.
Right-click on the 'Full Search Results' group and select 'New Selector'.
Give it a name of 'FullSearchResults'.
Give it a prompt of 'FullSearchResults'.
Set 'Group' to 'Other'.
Under 'Place of Setting', select 'Site'
Set 'Tab Name' to 'Product'.
Change to the 'Values' tab.
Highlight 'Standard Full Search Result' in the left list and click the '>' button to move it to the right-list.
Change back to the 'Basic Definition' tab.
Click 'OK'.
Now we need to display the Full Search Results layout.
Go to Design / Library / Layouts / Search Results, right-click 'Standard Search Result' and choose Copy.
Rename that copy to be 'Full Search Result'.
Double-click 'Full Search Result' and replace all code there with the following:
<Actinic:S_FULLRESULTS/>
<actinic:block if="%3cactinic%3avariable%20name%3d%22SearchResultShowsName%22%20%2f%3e"> <!-- V1004 fix --> </actinic:block>
<br clear="all" />
<hr/>
OK out.
We need to put some code to actually create these helper files.
Go to Design / Library / Layouts / Product Lists.
For each list there (usually 3 - with matrix type icon) add the following code at the top:
<actinic:variable name="FullSearchResults" />
Repeat for all layouts there.
NormanRouxel
14-Oct-2007, 12:40 PM
And the second bit:
Now a tweak is needed to the Search Results Page Bulk Area to allow for product forms in the results.
Go to Design / Library / Layouts / Web Page Inner Layout / Search Results Page Bulk Area.
Replace all code there with:
<table border="0" cellpadding="10" width="<actinic:variable name="ACTSTDWIDTH" />" align="center">
<tr>
<td>
<b><Actinic:Variable Name="SearchResultSummary"/></b><br />
<Actinic:Variable Name="SearchResultContinue"/>
</td>
</tr>
<tr>
<td>
<actinic:variable name="SearchResultsList" />
</td>
</tr>
<tr>
<td>
<b><Actinic:Variable Name="SearchResultSummary"/></b><br />
<Actinic:Variable Name="SearchResultContinue"/>
</td>
</tr>
</table>
<hr size="1" />
<form method="get" action="<actinic:variable name="OnlineScriptURL" value="Search Script URL" />">
<input type="hidden" name="RANDOM" value="<actinic:variable name='Random'/>" />
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e">
<!-- Hidden field when in trial mode -->
<input type="hidden" name="SHOP" value="<Actinic:Variable Name="HiddenFields"/>" />
</actinic:block>
<input type="hidden" name="PAGE" value="SEARCH" />
<table border="0" cellspacing="0" cellpadding="0" width="<actinic:variable name="ACTSTDWIDTH" />" >
<tr>
<td colspan="2" valign="top">
<Actinic:Variable Name="SearchPrompt"/> <Actinic:Variable Name="RetailOnlyWarning"/>
<br /><br />
</td>
</tr>
<tr>
<td valign="top" align="center">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td valign="top">
<b><Actinic:Variable Name="SearchString"/></b><br />
<input type="text" name="SS" size="40" />
<br />
<Actinic:Variable Name="SearchCombine"/>
<input type="radio" name="TB" checked="checked" value="A" />
<Actinic:Variable Name="SearchAndPrompt"/>
<input type="radio" name="TB" value="O" />
<Actinic:Variable Name="SearchOrPrompt"/> <Actinic:Variable Name="SearchCombineText2"/>
<script language="javascript" type="text/javascript">
<!--
for (nIndex = 0; nIndex < document.forms.length; nIndex++)
{
if (document.forms[nIndex] && document.forms[nIndex].SS)
{
document.forms[nIndex].SS.focus();
}
}
// -->
</script>
</td>
<td valign="top">
<actinic:block if="%3cactinic%3avariable%20name%3d%22PriceSearchIsAllowed%22%20%2f%3e">
<b><Actinic:Variable Name="SearchPriceRangeLabel"/></b>
<br />
<actinic:variable name="SearchPriceBandList" />
</actinic:block>
</td>
</tr>
<actinic:variable name="SearchablePropertyList" />
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsSearchablePropertiesCombinedWithAnd%22%20%2f%3e" />
<input type="hidden" name="GB" value="A" />
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsSearchablePropertiesCombinedWithOr%22%20%2f%3e" />
<input type="hidden" name="GB" value="O" />
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22SearchBySectionsUsed%22%20%2f%3e" />
<tr>
<td colspan="2" valign="bottom"> <b><Actinic:Variable Name="SearchControlLabel"/></b><br />
<select name="SX">
<actinic:block if="%3cactinic%3avariable%20name%3d%22SetupSearchAllSections%22%20%2f%3e%20%3d%3d%20False">
<option value="0"> </option>
</actinic:block>
<actinic:variable name="SearchSectionList" />
</select>
</td>
</tr>
</actinic:block>
<tr>
<td colspan="2"valign="bottom">
<input type="submit" name="ACTION" value="<Actinic:Variable Name="SearchLabel"/>" />
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- alert("<Actinic:Variable Name="UnregCustomersNotAllowedMessage"/>");
return false; -->
</form>
OK out.
The final patch is to edit SearchScript.pl (in your Site folder - back it up first).
Look for the line:
$ACTINIC::B2B->SetXML('S_ITEM', ($nCount + 1));
Immediately under it add the following:
#
# Full Search Results Hack
#
my $sResultsProdref = $$rarrResults[$nCount]; # the product ref
$sResultsProdref =~ s/([^A-Za-z0-9])/sprintf("_%02x", ord($1))/seg; # transform non alphanumerics like EncodedProductAnchor
my $sResultsFilename = 'sr_a' . $sResultsProdref . '.html'; # form filename
my $sResultsFullFilename = '<actinic:variable name="PathFromCGIToWeb" />' . $sResultsFilename;
if (-e $sResultsFullFilename) # look for file
{
open(FH, $sResultsFullFilename);
my $sResultsHTML = do { local $/; <FH> }; # load entire file
close(FH);
$ACTINIC::B2B->SetXML('S_FULLRESULTS', $sResultsHTML); # and store for display
}
else
{
$ACTINIC::B2B->SetXML('S_FULLRESULTS', 'Not found: ' . $sResultsFilename); # error if not found
}
Save and exit.
That's things installed. Your site should operate as before.
Now the final stage is to replace the usual search results with our new all-singing ones.
Go to Settings / Site Options / Layout / Other / Search Result Layout and select 'Full Search Results'.
You can switch back to the olde Search Results by selecting 'Standard Search Results'
That's it. Do a Site Update and see how the search results performs.
NormanRouxel
14-Oct-2007, 08:15 PM
Update: You cannot use the Product Reference (or ProductID) to generate filenames. The Perl line in post#1 above
$sExtendedFilename .= $$rarrResults[$nCount];
Will create an invalid filename if the Product Reference contains a forward or back slash, etc. E.g. / \. As this is quite common - ACME/1234 - it will be necessary to ensure that you either never use such characters or automatically replace them with something safe.
I've altered my patch above to use EncodedProductAnchor which is always filename safe. And added some tweaks to the SearchScript Perl to translate the Actinic product references into the corresponding anchor strings.
outboxin
01-Nov-2007, 08:38 PM
I have followed your instructions above, the pages have been created (I can view them in the html folder of my site), but the search results page does not display them. I get the correct number of results, but just a series of horizontal lines with nothing between them (the area where the results should be).
What did I miss? Is there a setting that needs to be changed for linking to external files??
Here is the url: http://trials.actinic.com/trials/trial45254/index.html
gabrielcrowe
02-Nov-2007, 07:46 AM
norm: this is magical as well. you perl people make me proud to be an Actinician.
I did the exact same thing, but with ajax.
i'll post some code if i manage to get it togther.
NormanRouxel
02-Nov-2007, 09:33 AM
Lauren
I see from your URL that you are testing on an Actinic trial server. Perhaps that is preventing the patched SearchScript.pl from being uploaded.
Check with Actinic and report back.
outboxin
02-Nov-2007, 02:39 PM
Norman,
Thanks for your response.
I moved the site to my server (you were correct about the search script being uploaded).
Search results still not working.
Url is http://www.outboxin.com/skoshop.html
Thanks again.
Lauren
NormanRouxel
02-Nov-2007, 07:11 PM
When I look in your generated search results I see (for each line returned)
<Actinic:S_FULLSEARCHRESULTS/>
However I don't see <Actinic:S_FULLSEARCHRESULTS/> anywhere in my patch. I do see <Actinic:S_FULLRESULTS/>. Creative editing perhaps?
NormanRouxel
04-Nov-2007, 08:34 PM
Lauren,
I see you've fixed it. You might want to edit that 'Standard Full Search Result' layout to give it a more compact tabular look. You may also want to go to Settings / Search Settings / Results and turn off 'Highligt Located Text' as this adds an extra level of Perl processing that slows things down and produces nothing useful.
If anyone wants to see one of the "Holy Grail" patches - fully buyable search results - in operation; go to http://www.outboxin.com/skoshop.html and search for e.g. "potion".
outboxin
04-Nov-2007, 10:02 PM
Thanks Norman ... yes, got it working .... grrrr ..... had only looked at that line of code about 50 times?!? My task for tomorrow morning was to try and figure out how to get the results into 2 columns .... any words of advice?
Thanks again .... you're hack is fantastic!
Lauren
valley decor
05-Nov-2007, 12:56 AM
Hi Norman,
This search page is great. The only thing is that when the page is finished loading, it is on the bottom of the page, not on the top.:confused: :confused:
How can this be fixed??
Thanks,
Regards,
NormanRouxel
05-Nov-2007, 01:47 AM
Bob,
What page?
valley decor
05-Nov-2007, 11:30 AM
Hi Norman,
Sorry...
Search fo lamps on my site...
www.valleydecoratingdepot.com
Thanks!!
Regards,
outboxin
05-Nov-2007, 01:11 PM
hmmmm ... what platform are you viewing on? Works fine on PC, but on mac (safari) when the search results page loads it jumps down to the bottom of the page (as if it is jumping to an anchor) to right above the new search area.
outboxin
05-Nov-2007, 05:53 PM
I'm probably being dense here but ....
If I edit the 'Standard Full Search Result' layout to be two columns it just shows each result twice and if I try to do it by adding a new list to the search result list layouts I do not get the option to edit the list layout settings (as in a product list layout) so that I can add multiple two column rows ...
Any help would be appreciated.
Lauren
NormanRouxel
05-Nov-2007, 07:54 PM
Lauren,
What you are trying won't work. Such functionality is for building static HTML pages on your desktop PC.
What we're doing is generating a sequential list using Perl on the server.
I have an add-on (see www.drillpine.biz/actinicstuff ) that allows for multi-column search results. However, this is intended for normal Actinic sites and it would require paid for customisation to adapt to this Full Search Results tweak.
valley decor
05-Nov-2007, 09:59 PM
Windows platform. Vista here IE7, FF ans Oprea and I tried it on win2000 IE6 and still the same thing, page loads to the bottom.:confused: :confused:
Yes, it wants to show the new search area.
Any clue why??
Thanks,
Regards,
outboxin
06-Nov-2007, 03:49 PM
Yes ... Thanks Norman .... took me awhile (clearly was being dense) but I figured this out (ridiculously) late last night.
Thanks again for your help.
Bob,
The form is jumping to the bottom of the page because the page is focusing on the search text field. If you remove the following code on your search results page this will stop (I guess the other option would be to leave this code and to move the search form on the search results page to the top of the page)
<script language="javascript" type="text/javascript">
<!--
for (nIndex = 0; nIndex < document.forms.length; nIndex++)
{
if (document.forms[nIndex] && document.forms[nIndex].SS)
{
document.forms[nIndex].SS.focus();
}
}
// -->
</script>
valley decor
09-Nov-2007, 12:30 AM
Thankyou very much Lauren!!! It worked!!
BTW, how did you know that the page was focusing on that field??
Thanks!!
Regards,
outboxin
09-Nov-2007, 04:12 PM
Your welcome.
I noticed that the search page was jumping down exactly to the search box and that the cursor was already in that box .... so I looked for the form focus script.
OriginalTouch
20-Nov-2007, 01:54 PM
Any idea why some products that should be in the search results actually return an error such as:
Not found: sr_aFIBPM100_2E013.html
I'll also try and see where there is code missing
EDIT:
It appears that this error code only happens to the products without components. Works fine for those with components (set up as sizes).
Also, search results show items that should only be available for registered or logged in customers.
Also, when adding a product to the cart, bounces to the home page.
NormanRouxel
20-Nov-2007, 05:50 PM
No-one can help without knowing what to search on and which item is misbehaving.
OriginalTouch
21-Nov-2007, 09:25 AM
As this wasn't working, I changed it back to the standard search page.
I will now change it back to the Full Search Results for you to see.
Look at:
http://www.spcb.co.uk/acatalog/Fibreglass.html
Here is a list of 4 filters, including 2 offending ones. You will see which is which by the product code in the error.
Then search for "filter".
As mentioned, there are quite a few products with error codes, including these 2 at the top.
Not found: sr_aFIBPM100_2E013.html
--------------------------------------------------------------------------------
Not found: sr_aFIBPP100_2E001.html
The only thing they all have in common that is different from the products that are shown correctly, is that they do not have components. (May even be a set up for these items).
NormanRouxel
21-Nov-2007, 04:00 PM
I see the fault now. You have non alphanumerics in your product references. Actinic replaces these with _xx (2 digit hex code) when creating the support file names. So Actinic is writing files named e.g. (for product ref: FIBPM100.013) sr_aFIBPM100_2e013.html[/B] but the Perl patch is looking for sr_aFIBPM100_2E013.html and the upper case and lower case E are different characters.
Try this fix:
Edit SearchScript.pl and look for
$sResultsProdref =~ s/([^A-Za-z0-9])/sprintf("_%02X", ord($1))/seg; # transform non alphanumerics
Replace with
$sResultsProdref =~ s/([^A-Za-z0-9])/sprintf("_%02x", ord($1))/seg; # transform non alphanumerics
And do an Update and report back so I can change the patch if that fixes things.
OriginalTouch
21-Nov-2007, 04:40 PM
Yes this seems to have worked!
Well done!
You see the main products with components did not have these non-alphanumerics, only the components.
By the way, I have sent you an email for info on buying your 'add to cart by product reference' add-on.
NormanRouxel
21-Nov-2007, 04:51 PM
Glad that fixed it. There are about 1,500 things you have to consider when writing an Actinic patch and this one only came to light when you have non-alphanumerics in your product ref's and are using a Unix / Linux server. I'll amend the main post above.
OriginalTouch
21-Nov-2007, 04:58 PM
2 points which may make the difference about whether I use this:
Can you stop products appearing that are usually on a page that you should be logged on / registered?
I have already input the 'stop the bounce page' code in the AUG so that usually when adding to cart, the page stays static. Can this happen here too? Still bounces back to page previously viewed. Would like the customer to stay on the search page if he wants to choose more than one product.
NormanRouxel
21-Nov-2007, 05:08 PM
The patch shows products that would appear in the usual Search Results, so I don't think you can restrict this to registered customers only. Best use on Catalog sites only.
I don't use the bounce tweak so cannot help there.
OriginalTouch
22-Nov-2007, 04:11 PM
I have found a way of hiding the search results for non-registered customers.
For your info:
Hardcode the link to the product within a fragment on the top section using:
!!< <a href="url"> link words. </a> >!!
Then hide the sub-section / product from the website in the General Tab, where you will also find an option to hide from Search Results.
The hardcoded link will still go to a hidden section.
Use an explanation at the product page such as:
"Due to the nature of this product, you need to be logged in before you purchase this item. If you are not registered, please register before adding this product to your basket, and we will send you an email with a password. You can purchase any non-restricted products before registering.
Registered Customers Only - Buy Online Now "
Design2Please
10-Dec-2007, 04:10 PM
Hi,
I made the changes to the search results and had everything running fine. Since then I have made a couple of changes to shorten the product name on some products - Now when you view the products I have changed in the search results they seem to have changed the search results layout for these products. I have checked some of product details of the ones i have changed against some i didnt ut dont seem to be able to spot any differences. Does anyone have any ideas?
This link shows you what i mean:
http://www.designtoplease.co.uk/cgi-bin/ss000001.pl?REFPAGE=http%3A%2F%2Fwww.designtoplease.co.uk%2Fcgi-bin%2Fss000001.pl%3FREFPAGE%3Dhttp%253A%252F%252Fwww.designtoplease.co.uk%252F%26page%3Dsearch%26PR%3D-1%26TB%3DA%26SS%3Dframe&page=search&PR=-1&TB=A&SS=Strawberry+Multimedia+
The products I have changed are the ones where the search results layout shows the product name under the image as opposed to next to it.
NormanRouxel
10-Dec-2007, 07:52 PM
Jonathan,
That link is only usable when used within an Actinic live site. If I go to e.g. http://www.designtoplease.co.uk/acatalog/furniture.html and search for "Red" I get:
Not Found
The requested URL /acatalog/Terms & Conditionsnic:block if= was not found on this server.
Apache/2.0.46 (Red Hat) Server at www.designtoplease.co.uk Port 80
Which makes me think that you've corrupted the Perl or the search results layout.
Design2Please
11-Dec-2007, 10:50 AM
Hi Norman,
Thanks for pointing that out, reverted back to a my last snapshot which appears to have fixed the search error however the layout issue is still occuring for the products i chnaged:
http://www.designtoplease.co.uk/cgi-bin/ss000001.pl?page=search&PR=-1&TB=A&SS=strawberry+multimedia
Kind Regards
NormanRouxel
11-Dec-2007, 03:46 PM
Posting a cgi based link is useless here on the Forum (Actinic gets all confused and thinks that the site is hosted on community.actinic.com).
You need to post a normal page link. a string to search on, and describe what and where a normal and changed product is and looks like / should look like.
Design2Please
11-Dec-2007, 04:02 PM
Posting a cgi based link is useless here on the Forum (Actinic gets all confused and thinks that the site is hosted on community.actinic.com).
Sorry I hadn't realised that was the case.
If you go to www.designtoplease.co.uk and search on "strawberry multimedia".
The top result "Strawberry Multimedia Renoir 7" Frame 7001" is the correct layout whereas the "Strawberry Multimedia Milan 7" Frame 7003" is using the wrong layout (this is the case with several products where I made changes to shorten the product name.).
Kind Regards
NormanRouxel
11-Dec-2007, 05:03 PM
I made changes to shorten the product name
Are you saying that you simply edited the Product Name field and your layout changed?
Design2Please
11-Dec-2007, 05:13 PM
Are you saying that you simply edited the Product Name field and your layout changed?
Hi Norman,
Yes this appears to be the case - I had a couple of products that I had to shorten for product name to work in my affiliate feed, and since reuploading the products I changed have seen a change in their search results layout.
New products I am creating are all appear fine it just seems to be the products where I shortened the product name.
Kind Regards
NormanRouxel
11-Dec-2007, 05:22 PM
You have replaced the 'Full Search Results' layout from my post with some code of your own.
This has horribly mismatched, missing and spurious table tags, nested anchors and other coding faults. Firefox manages to render this but it fails in IE.
Best go back to my code and use it as the basis for your layout.
leehack
11-Dec-2007, 06:20 PM
This always perplexes me i must say, how on earth can you be given a solution, stray quite significantly away from it and then state it's not working. Is it me on my different planet or is that way of working nothing short of plain ludicrous? What do i miss in these situations, i sit here baffled at times.
Design2Please
11-Dec-2007, 08:20 PM
Best go back to my code and use it as the basis for your layout.
Hi Norman,
Thanks again for your help. The only layout I remember altering was the code where you mentioned - "this is just a copy of the Standard Product Layout using CSS): and then below the code said - "You can amend this as necessary. Or copy in other Product Layouts." and so had changed this to fit better across the page, although it is possible I changed something else by accident - the reason I didnt think I had was because until I changed the product name on some of the products all the search results were showing correctly and so it appeared that this may have caused some issues. However I will go back to the start with your code and work from there which should hopefully resolve the issue.
As always Norman I am very grateful for your help with this.
This always perplexes me i must say, how on earth can you be given a solution, stray quite significantly away from it and then state it's not working. Is it me on my different planet or is that way of working nothing short of plain ludicrous? What do i miss in these situations, i sit here baffled at times.
Lee have I said something to upset you or something as I was only asking if anyone could suggest what might have happened and at no point did I try saying this didnt work. I clearly stated in my original post that I had everything working fine when i first implemented the search hack I only started seeing errors after I made some changes to product names. I did not know it was wrong to ask for advice when I got stuck with something - I have always tried to answer other peoples queries when I can and have always tried to post solutions to problems that I have solved for reference for other users. I have always thanked anyone that has helped and at no point ever tried to point the finger or blame anyone else when something has gone wrong - I appologise if somehow you thought this was the case.
Kind Regards
leehack
11-Dec-2007, 08:45 PM
Lee have I said something to upset you or something as I was only asking if anyone could suggest what might have happened and at no point did I try saying this didnt work. I clearly stated in my original post that I had everything working fine when i first implemented the search hack I only started seeing errors after I made some changes to product names. I did not know it was wrong to ask for advice when I got stuck with something - I have always tried to answer other peoples queries when I can and have always tried to post solutions to problems that I have solved for reference for other users. I have always thanked anyone that has helped and at no point ever tried to point the finger or blame anyone else when something has gone wrong - I appologise if somehow you thought this was the case.
I don't think i put my point across very well having reread it. I am not upset at all (certainly not with you), more completely misunderstanding what goes wrong in these situations and trying to understand them. How do clear instructions fail so often on a forum etc. Google analytics thread is another prime example.
I read your post and thought, does he really think because he shortened a product name it all went wrong, i guess when it happens to you and it is new ground, you can look for any reason other than the logical one.
It was not meant to be directed at you, more a baffled question, apologies if it seemed that way.
Design2Please
08-Jan-2008, 03:11 PM
Sorry I have not replied to this thread for while I have been rather busy over Xmas period.
Just wanted to post to say I found out what was causing the layout to appear wrong for the products where I had shortend the name. I had accidentally left a space at the end of the product names when I shortened which them which caused issues with the layout. e.g. "product name " instead of "product name".
It was not meant to be directed at you, more a baffled question, apologies if it seemed that way.
Lee - Apologies if I took your post in the wrong way - I was getting very frustrated with the issue and so was probably a bit hasty to snap back.
valley decor
10-Feb-2008, 02:45 AM
Hi All!!
I was wondering if anyone can help. The search button in the 'Search Results Page Bulk Area' stopped working. Not sure what I did, but everything else is OK. Just doing some "cosmetic work". Previous snapshot is the same. Maybe it never worked??
Thanks in Advance!!:D :D :D
Regards,
NormanRouxel
10-Feb-2008, 08:37 AM
Bob,
The </form> tag at the end of your Search fields is missing.
danlou84
15-Feb-2008, 12:55 PM
paul,
as a sidenote, I went to the site, and initially tried to type into the area called "FIND", it took me a few seconds to realise that although it looked like an input field, iy was in fact a title for the "Find" area
having said that the patch is a good one, thanks
exactly the same lol
RHibberd
07-Apr-2008, 12:39 PM
When I look in your generated search results I see (for each line returned)
<Actinic:S_FULLSEARCHRESULTS/>
However I don't see <Actinic:S_FULLSEARCHRESULTS/> anywhere in my patch. I do see <Actinic:S_FULLRESULTS/>. Creative editing perhaps?
Hi Norman
I'm getting the same result, just the horizontal rules but my code does show <Actinic:S_FULLRESULTS/>
site : http://domain501676.sites.fasthosts.com
I've been through your instructions twice and can't find what's preventing it working... any ideas please?
Regards
Ruth
NormanRouxel
07-Apr-2008, 11:03 PM
Ruth,
This is complex patch and it's almost impossible to diagnose remotely. All I can tell from here is that the sr_*****.html files are correctly being generated. What's in SearchScript.pl or the Results Template is not available to me.
Whatever else is wrong is beyond me. Long standing experience tells me that about 90% of people who say they've followed the instructions exactly - haven't.
NormanRouxel
07-Apr-2008, 11:52 PM
Update.
I just installed this patch from posts 8 and 9 to check it was OK. It was.
However I found a way to simplify the code needed in layout 'Standard Full Search Result', so I've amended post #8 to reflect that.
If you're already using the patch and want to update it, do this:
Go to Design / Library / Layouts / Full Search Results / Standard Full Search Result and replace all code there with
<actinic:variable name="ProductLayout" />
You can amend this, if required, to use other Product Layouts - perhaps use a fixed layout that's a bit more concise.
RHibberd
08-Apr-2008, 03:47 PM
I'll try it again with your amend and fingers crossed! (Should make for interesting typing!) :-)
kernock
15-Apr-2008, 01:36 PM
Fantastic patch...
Has anyone made amendments so that fragments show up as well as product layouts?
Julian
kernock
16-Apr-2008, 09:37 AM
Has anyone managed to make amendments to the perl patch to make this one work with v9 yet...
There must be a variable rename or something that is stopping it from working... does anyone have any ideas.
Thanks
Julian
kernock
16-Apr-2008, 09:42 AM
never mind - works fine with v9 - its me being a muppet!!!
eshopbrokers
16-Apr-2008, 10:58 AM
It's a great patch. I had it looking really good with add to basket buttons and everything. :)
But after I installed the v9 update its gone...
kernock
16-Apr-2008, 11:04 AM
once you install v9, actinic overwritese the searchscript.pl file that.
Just re do the perl script changes and you should be all ready to go...
(near the bottom of normans post on page 1 - just abot the last thing you had to do.
eshopbrokers
16-Apr-2008, 11:21 AM
Thanks its all working again now!
;)
bentleybloke
01-Jun-2008, 04:07 PM
This is an excellent patch btw. However, I just noticed something whilst testing which may be noteworthy.
If you have a discount group setup with the original products in a hidden section and the store populated by duplicates an appropriate sr_*****.html helper file isn't created for the discount products when you click GROUPLINK to see a list of the offer products.
Andy Warner
31-Jul-2009, 08:23 PM
Ive just implemented this on Legendgames and am currently doing it on RPGMiniatures, if you want to see it in action.
I have learn a few things just doing this, for example I had trouble changing the ProductLayout to one of my own:
Now you need to put some layout code into this layout.
In the Edit Layout Code window paste the following (this will use the layout defined for each product):
<actinic:variable name="ProductLayout" />
You can amend this, if required, to use other Product Layouts - perhaps use a fixed layout that's a bit more concise.
Until I applied a bit of thought: So, note to people unfamiliar with this process (i.e. me until 10 mins ago!)
You know when you edit a layout, you can just start typing and pre-defined Layouts, Variables etc pop up in a list matching what you are typing... Well, I made a new Layout and it DIDNT pop up in the list...
Then I realised that if I want to be able to add a single NEW layout by typing it in (eg one as follows<actinic:variable name="AndysProductLayoutForSearchResults" /> ) then I needed to create both the new layout, and a new selector for it, then add the layout to the selector.
Yeah, kind of obvious when you consider many Layouts have names like 'Product Layout for CSS V8' and they NEVER pop up - its the selector that holds them that pops up when you type! oh yeah!!
To all involved, cool hack. brilliant.
Andy Warner
31-Jul-2009, 08:59 PM
Ive implemented as I said, but I noticed that I get an odd FTP error when uploading (5k + products)
The Site Update runs smoothly, the sr_xx.html files are generated, then just before the physical upload via FTP, a popup appears, something like: "FTP:cannot change directories > Retry or Ignore?"
So I press Retry, and it all works perfectly.
Odd.
Anyway... I run Mole End batch processing (you DONT??? you SHOULD!!!) and that has a settign to ignore or retry that kind of dialog, which I always set to IGNORE because thats whats best if you get those passive errors or image duplication messages...
Anyway 2... because that IGNORES rather than RETRIES, the ftp upload fails.
It looks like the processing is taking so long with that many files, the FTP connection goes to sleep. A 'retry' wakes it.
I've asked Mole End about it, and Pinbrook (my hosts) so I hope there is a work around. It might be that it only occurs when a whole load of new sr_xx.html files are produced or changed (eg layout changes are made) as that takes so much time on a big site... It might just be a glitch in my system - i'll keep thee informed.
Andy Warner
29-Nov-2009, 11:32 AM
Hi all,
Ive got the 'add to cart' working from the search page. :)
However, I need the original links to section / page as well - I want people to be able to look at the page the item comes from, not JUST be able to add it.
Ive looked at the Pearl script.... but I cant figure out how I can implement BOTH the file output AND the original output.
>>EDIT
OK OK - I think need to change the Search Results layout in actinic, not hte seach script.:p
<<EDIT
If anyone has done this, please share...!
I'm willing to pay/donate for the updated hack - V8 by the way.:D
NormanRouxel
29-Nov-2009, 12:46 PM
Andy,
I presume you want something like a "See more details" button or link that will take you to the usual product page.
This can probably be done but would require intensive investigation. It would need more time than I can provide here.
If no one else can help email me for a quote.
Andy Warner
29-Nov-2009, 01:02 PM
hey Norman, thanks for the reply.
I was thinking as a quick fix I'd like to see the 'new' search results (ive got image, name, quantity, price, add to cart, etc) from the hack, plus on the next line, the OLD seach results minus the image really.
in the longer term, the 'hack' output plus a 'goto section' and 'goto product' link. If people search for a specific item, it just adds to cart, so currently they dont see other related items in the same cateory.
Don't go to town on this onE UNLESS you really are bored, eh?
NormanRouxel
29-Nov-2009, 01:45 PM
It may not be as difficult as I thought. All the Actinic replacement tags work in the Full Search Results layout. So just copy / paste in the bits you want some from the Standard Search Results lasyout and see what happens.
E.g.<br/><Actinic:Variable Name="SearchResultLink"/><b>See more details</b></a>
Links you to the normal product page.
Andy Warner
29-Nov-2009, 01:48 PM
you confirm my thoughts - doing the post at present, may play tonight if 2 year olds, wife and TV allow me to......
**
thanks to X factor, I had time to update the search page, and yes, it does work fine. Customers can now navigate to the section the item is in from the search page, or buy it directly from the search.
**
thanks muchly Norman.
Andy
HowardW
12-Feb-2010, 05:21 PM
Hi
Have been using this hack for some time, without problems.
However, is it possible that anyone ordering from the search page, do not go back to the page they searched from, but stay on the search page?
Regards
Howard
eskeys
19-May-2010, 04:45 PM
Hi
is it possible that anyone ordering from the search page, do not go back to the page they searched from, but stay on the search page?
yes, I've just started using this mod and would very much like it to return to the search results page so I can add more items to the cart. At the moment it goes back to a blank search page and I have to enter the search criteria again.
Is this how the mod is supposed to work?
many thanks,
Paul
GraemeKustom
09-May-2011, 09:37 AM
Per chance, does anyone have this working in 10.0.3 or 10.0.4 ? I found that it was fine in 10.0.2 but upgrading to either of the above results in the search results coming up blank.
Have tested on our own site and also with the default example Actinic site just in case there was something else causing it.
Obviously realise the patch has to be reapplied in SearchScript to make it work after an upgrade.
For ref, I've left the example site with the script applied here test [dot] kustompcs.co.uk - if you run a search here it just comes up with a blank space
[Edit - I've asked Norman directly to look into this now]
eskeys
19-May-2011, 10:41 AM
Hello,
Did anyone find a fix for this in v10.0.4 please? I've just got back and needed to upgrade to V10.0.4 to get the flatfile converter to work but now the results are blank as described in the above post.
I have applied the patch to searchscript.pl after the upgrade.
10.0.3 changed the way files are stored for the site upload, but looking through the searchscript patch I cant really see where it would make a difference?
Many thanks,
Paul.
GraemeKustom
19-May-2011, 10:47 AM
Posts 8 and 9 in the thread were modified by Norman, if you update according to those again it will be corrected.
eskeys
19-May-2011, 10:48 AM
Posts 8 and 9 in the thread were modified by Norman, if you update according to those again it will be corrected.
Many thanks Graeme (and also to Norman of course!)
NormanRouxel
19-May-2011, 11:15 AM
If you're updating to 10.0.3 onwards, you only need to go to post 8 at the beginning of this thread and do the bit marked:
Double-click 'Full Search Result' and replace all code there with the following:
And re-patch the Perl changes as they invariably get clobbered by an Actinic update. I.e. do post 9, marked:
The final patch is to edit SearchScript.pl.....
GraemeKustom
12-Jun-2011, 04:16 PM
Anyone had any success enabling Real Time Stock Levels on these fragments?
I've added Realtime Stock display on the section and extended info pages succesfully, and thought this would still work on the search page as long as the javascript was added to the header.
Have put this in but it doesn't seem to be working.
Have examined the html for the products on the search page and the section page and they are the same, and have checked that the javascript code is appearing there okay, and it does, but I think the issue is that since product stock is looked up by section, on the search page the javascript shows
getSectionStock with the section field set to '1' always, where it might be '135' when looking at an actual section page.
Maybe someone has spotted a way of bypassing the lookup to be specific to one section only? I don't think putting all of my products in one section and then using duplicates would be ideal, as there's about 3000 of them so I expect that's a bit too many for one section...
malbro
13-Jun-2011, 07:08 AM
Anyone had any success enabling Real Time Stock Levels on these fragments?
I've added Realtime Stock display on the section and extended info pages succesfully, and thought this would still work on the search page as long as the javascript was added to the header.
Have put this in but it doesn't seem to be working.
Have examined the html for the products on the search page and the section page and they are the same, and have checked that the javascript code is appearing there okay, and it does, but I think the issue is that since product stock is looked up by section, on the search page the javascript shows
getSectionStock with the section field set to '1' always, where it might be '135' when looking at an actual section page.
Maybe someone has spotted a way of bypassing the lookup to be specific to one section only? I don't think putting all of my products in one section and then using duplicates would be ideal, as there's about 3000 of them so I expect that's a bit too many for one section...I did some work on making Stock Levels available on section pages which are parents to other section pages rather than parents to products which is available as a plug-in, not sure if it would work with searches but I will have a look.
malbro
13-Jun-2011, 08:40 PM
Anyone had any success enabling Real Time Stock Levels on these fragments?
I've added Realtime Stock display on the section and extended info pages succesfully, and thought this would still work on the search page as long as the javascript was added to the header.
In order to display the stock on a search page, the javascript needs to have access to the product references and the sections in which they are held. If you search for 'Camera' on this web site http://stockplugin.toddesigns.co.uk/ you can see stock control on the search page. The stock plugin will be updated with this new feature later this week.
GraemeKustom
13-Jun-2011, 10:05 PM
Ah, ideal - the component stock level display would be handy as well, so that's a bonus :)
I'll happily purchase the plugin now if you provide the updated version later with support for the search facility?
[Edit : I think I'm sold on that Ajax cart plugin now as well, that's wonderfully slick looking]
malbro
14-Jun-2011, 09:08 AM
Ah, ideal - the component stock level display would be handy as well, so that's a bonus :)
I'll happily purchase the plugin now if you provide the updated version later with support for the search facility?
[Edit : I think I'm sold on that Ajax cart plugin now as well, that's wonderfully slick looking]Hi
Getting the components onto the search list is next task then its ready to issue, happy to update free of charge.
jadetechnology
08-Jul-2011, 04:13 PM
I have read through these threads and you say at the start that this won't work with 'Single Add To Cart pages'. I'm running Enterprise V10.0.3 LAFA and in under Site Options|General|Section it is written 'Single Add to Cart Layout' and 'Single Add to Cart Button' is selected. Does this mean the patch won't work on my site?
In Design|Design Options|Shopping Mode, I have 'Quantity in Shopping Cart' selected and not 'Quantity on Product Page'.
Just wanted to get an idea of whether this patch will work for me and how the changes may affect my site www.jadetechnology.co.uk
Thanks a lot.
leehack
08-Jul-2011, 04:39 PM
That's a selector where you specify the layout to use if you are using SATC. If you are not, the selector would still be there, so unless you have selected to set your site up for SATC (multiple products per page), then no you are not using SATC. If unsure, add 3 products into a section, and count how many add to cart buttons you have, if more than 1 then you are not SATC.
matatcdata
17-Oct-2011, 09:10 AM
Hi Norman
I'm getting the same result, just the horizontal rules but my code does show <Actinic:S_FULLRESULTS/>
site : http://domain501676.sites.fasthosts.com
I've been through your instructions twice and can't find what's preventing it working... any ideas please?
Regards
Ruth
Same, I've been through it numerous times and I'm still getting horizontal lines. could it be trying to make the v10 patch work in v9?
NormanRouxel
17-Oct-2011, 04:44 PM
Mathew. You also have to patch SearchSript.pl. If that's not done I'd expect the <Actinic:S_FULLRESULTS/> to display instead of the actual products.
Also, this probably won't work if you're on Actinic Trial Hosting. You need the patched SearchScript.pl to be uploaded to the server and I've a feeling that Trial hosting uses a standard set of scripts for everyone.
Can't see why it won't work on V9. Search scripts are very similar.
Magic Parts
01-Dec-2011, 10:34 AM
Did anyone get this patch to work with Fragment Brochure Pages?
I'd like to see applicable Fragment Brochure Pages appear properly in the search results with a link to the actual fragment Page, and without the "add to cart" button.
Any info useful.
NormanRouxel
01-Dec-2011, 11:06 AM
Reread post eight. That was updated recently to allow for Fragments.
N.B. Search doesn't include Brochure Fragments. Only Section ones.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.