Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

V4 - auto search using vars in url

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-12-2005, 07:12 AM
 
mmaner mmaner is offline
 

Advanced Member
  
Join Date: Apr 2003
Location: Florence, AL
Posts: 50
 

Default V4 - auto search using vars in url

I used to be able to use this link to automate a search by product code...

http://www.wittrans.net/ecart/customer/search.php?substring=24070

24070 being the product code.

I searched through the forums and found that this has essentially been disable in v4. Is there a work around or anything.

I have an exploded view of a Product that is made up of multiple parts. Each of those parts is available as Used, New, Remanufactured, blah blah blah. The part number is the same for all versions it just has a U, R or an A infront of the part number. I had previosly assumed that I could do an auto search based on the part number and get all the versions. Now it turns out that I can't.

I am willing to pay for this functionality. Please IM me with the pricining info.

thanks
__________________
***
X-Cart Gold 4.0.13 on Linux RedHat 9 i686
Reply With Quote
  #2  
Old 04-12-2005, 08:39 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

You have to either use a POST to your search.php or reformat the search.php to use a GET instead.
Reply With Quote
  #3  
Old 04-12-2005, 08:46 AM
 
mmaner mmaner is offline
 

Advanced Member
  
Join Date: Apr 2003
Location: Florence, AL
Posts: 50
 

Default

wow, I wish I was that good. Unfortunately I am not.

Essentially all I want to do is creat a link on my image map that do an auto search through the database & return the results as a product(s) listing.

I would rather find a way to use a POST so as to keep future upgrade paths available, but I don't have a clue what the syntax would be.

If I can't use a POST is it possible to replace the 4.0.13 version of 'search.php' with an older version so as to use a GET?
__________________
***
X-Cart Gold 4.0.13 on Linux RedHat 9 i686
Reply With Quote
  #4  
Old 04-12-2005, 09:13 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Not sure if just using an older version would work, you could always backup and try it, though I wouldn't expect it to work.

If you look at your search page and view source, you can pull the form from it and alter it to use on your page.

If you'd like a quote on doing it please PM me your page URL with what exactly your trying to do, and if you use MSN Messenger send me your handle so that we can speak directly if needed.
Reply With Quote
  #5  
Old 04-12-2005, 11:32 AM
 
mmaner mmaner is offline
 

Advanced Member
  
Join Date: Apr 2003
Location: Florence, AL
Posts: 50
 

Default

I received this response from X-Cart... I works great

1. Create 'auto_search.php' file in the '<xcart_root_dir>' folder.

2. Open this file and add following code :

Code:
--- <HTML> <BODY onLoad="document.process.submit();"> <TABLE width=100% height=100%> <TR><TD align=center valign=middle> <FORM action="search.php" method="POST" name="process"> <INPUT type="hidden" name="simple_search" value="Y"> <INPUT type="hidden" name="mode" value="search"> <INPUT type="hidden" name="posted_data[by_title]" value="Y"> <INPUT type="hidden" name="posted_data[by_shortdescr]" value="Y"> <INPUT type="hidden" name="posted_data[by_fulldescr]" value="Y"> <INPUT type="hidden" name="posted_data[substring]" size="16" value="<? echo $substr ?>"> <INPUT type="submit" name="submit1" value="JavaScript is disabled in your browser. Please press this button."> Please wait while searching...</TD> </FORM> </TR> </TABLE> </BODY> </HTML> ---

3. After that you will be able to use links like :

http://www.website.net/xcart/auto_search.php?substr=555555
__________________
***
X-Cart Gold 4.0.13 on Linux RedHat 9 i686
Reply With Quote
  #6  
Old 04-13-2005, 10:27 AM
 
sstillwell@aerostich.com sstillwell@aerostich.com is offline
 

eXpert
  
Join Date: Jun 2004
Location: Duluth, MN
Posts: 242
 

Default

wow, cool! I have implemented this but added a few polishing touches.

1. I don't want the "Javascript Disabled" showing when that is not the case.
2. I want the button only present if JS is indeed disabled.
3. I don't want the "Please wait" text if JS is disabled and they have to hit the submit button.
4. I also changed the URL variable to q (after the great Google)
5. Added the proper way to get php variables from an HTML GET string.

So here is my polished version

Code:
<?php $substr = $_GET['q']; ?> <HTML> <BODY onLoad="document.process.submit();"> <TABLE width="100%" height="100%"> <TR> <TD align="center" valign="middle" /> <FORM action="search.php" method="POST" name="process" /> <INPUT type="hidden" name="simple_search" value="Y" /> <INPUT type="hidden" name="mode" value="search" /> <INPUT type="hidden" name="posted_data[by_title]" value="Y" /> <INPUT type="hidden" name="posted_data[by_shortdescr]" value="Y" /> <INPUT type="hidden" name="posted_data[by_fulldescr]" value="Y" /> <script>document.write('Please wait while searching...') </script> <noscript> <h3>JavaScript is disabled in your browser.</h3> <INPUT type="submit" name="submit1" value="Continue >>" /> </noscript> <INPUT type="hidden" name="posted_data[substring]" size="16" value="<?php echo $substr ?>"> </FORM> </TD> </TR> </TABLE> </BODY> </HTML>
__________________
No longer using Xcart, was good while it lasted.
Reply With Quote
  #7  
Old 04-13-2005, 10:36 AM
 
mmaner mmaner is offline
 

Advanced Member
  
Join Date: Apr 2003
Location: Florence, AL
Posts: 50
 

Default

sweet bro

I just implemented it, and it rocks.
__________________
***
X-Cart Gold 4.0.13 on Linux RedHat 9 i686
Reply With Quote
  #8  
Old 04-14-2005, 01:59 PM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default

Excellent, well done.
__________________
xcartmods.co.uk
Reply With Quote
  #9  
Old 04-15-2005, 06:55 AM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

Default

Very nice work indeed sstillwell@aerostich.com
Thanks.
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------
Reply With Quote
  #10  
Old 04-15-2005, 09:05 AM
 
mmaner mmaner is offline
 

Advanced Member
  
Join Date: Apr 2003
Location: Florence, AL
Posts: 50
 

Default

here's a new one for ya...

I have had a ton of problems out of the BMY Add-On, I'm wondering if I can't do the same thing with this Auto Search.

Somthing like: http://www.website.net/xcart/auto_search.php?substr=ford,aod,hard_parts

Ford= Brand
AOD= Model
Hard Parts=Type

Any ideas would be appreciated
__________________
***
X-Cart Gold 4.0.13 on Linux RedHat 9 i686
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020