X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Linking directly to a search result (https://forum.x-cart.com/showthread.php?t=32978)

annasoaps 08-02-2007 05:41 AM

Linking directly to a search result
 
On the main page I would like to be able to link to a temporary category of products, let's say for instance that the scent of the week would be blueberries. If I search for Blueberry I get all the products that have a blueberry scent, so would it be possible to post a link with that search "built in"? (hope I'm making sense...):oops:

Or do I have to make a hidden subcategory and put the products in there manually?

Any ideas greatly appreciated!!
/Anna

Zaja 08-03-2007 02:40 AM

Re: Linking directly to a search result
 
Try the following code:
Code:

<a href="{$http_location}/search.php?mode=search&substring=blueberries&including=phrase&by_title=on&by_shortdescr=on&by_full descr=on&category_main=on&category_extra=on">blueberries</a>

annasoaps 08-03-2007 03:12 AM

Re: Linking directly to a search result
 
Thanks so much! It works perfectly!

Many thanks!

/Anna

Ene 08-03-2007 04:47 AM

Re: Linking directly to a search result
 
1 Attachment(s)
Each search result page has 'This page URL' link at the bottom. You can use this URL to create 'dynamic categories'.

Dawn Howard 08-07-2007 08:50 AM

Re: Linking directly to a search result
 
I'm trying this as well

Code:

http://www.duffystric.com/search.php?mode=search&substring=palm+island&including=phrase&by_title=on&by_shortdescr=on&by_full descr=on&category_main=on&category_extra=on

the URL by its self works fine, but I'm using it as part of a java script in the header:

Code:

{literal}
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var mfBanners = [
['http://www.duffystric.com/search.php?mode=search&substring=palm+island&including=phrase&by_title=on&by_shortdescr=on&by_full descr=on&category_main=on&category_extra=on', 'http://www.duffystric.com/1palm.jpg'],
['http://www.duffystric.com/home.php?cat=85', 'http://www.duffystric.com/1new.jpg']
];
var mfIe = false;
if( document.all) {
mfIe = true;
}
var mfBannerIndex = 0;
function mfBannerChange() {
var htmlString = '<a href="'+mfBanners[mfBannerIndex][0]+'"> <img border="0" src="'+mfBanners[mfBannerIndex][1]+'"></a>';
if( mfIe) {
document.all.banner.innerHTML = htmlString;
}
else {
document.layers["banner"].document.open();
document.layers["banner"].document.write( htmlString);
document.layers["banner"].document.close();
}
if(mfBannerIndex < mfBanners.length - 1)
mfBannerIndex++;
else
mfBannerIndex = 0;
}
setInterval("mfBannerChange()", 5000);
//  End -->
</script>
{/literal}



as part of the java script, the search pulls up all kinda of stuff with out the words: palm island.

help?

Polvo 10-03-2007 03:14 AM

Re: Linking directly to a search result
 
Quote:

Originally Posted by Zaja
Try the following code:
<a href="{$http_location}/search.php?mode=search&substring=blueberries&including=phrase&by_title=on&by_shortdescr=on&by_ full descr=on&category_main=on&category_extra=on">blueberries</a>


Any idea why adding the following doesn't work?
Code:

posted_data_by_sku=on

The URL created at the bottom of the search results doesn't work either, its:
Code:

http://www.mysite.co.uk/shop/search.php?mode=search&substring=sku123&including=all&by_title=on

Paul

Polvo 10-08-2007 09:10 AM

Re: Linking directly to a search result
 
I reported my last post as a bug and X-Cart support now have a fix which they installed for me. I can now search for a SKU via a URL.

Paul


All times are GMT -8. The time now is 11:41 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.