Guest Posted April 13, 2007 Posted April 13, 2007 Hello All A bit of a tricky one here ( tricky for me anyway). I need to list all products on a page that match certain criteria. Basically all products for a certain manufacturer with certain keywords in it. I though about coding the page manually but this will then display products even if they are removed from the catalog later, I need a dynamic solution. Any ideas? Even being pointed in the right direction would help. Thanks Paul
Dennis_gull Posted April 13, 2007 Posted April 13, 2007 you can do it with vars from the url. For example: you can link them to: www.your-shop.com/index.php?my_own_listing=5 Then if you write this on the page: echo $_GET['my_own_listing']; You would get the number 5... You can then use the information from the url to get data from the db. this is how the product_info, cpath, manufacturer and search path work.. on the index page you could write: if (isset($_GET['my_own_listing'])) { ..... <use the variable here to get the data you want> } else { .... all the normal data. } But you dont need to use the index page, you can just create a new one.
Guest Posted April 13, 2007 Posted April 13, 2007 Thanks Dennis I was thinking of using the URL but I was concerned that I would then have problems with the (excuse my lack of knowledge) tep_href_link functionality that seems to generate the osCsid=blahblah in the URL. As once the list is generated I need to link to the relevant items without losing the customers cart. So would this work (As an example). <?php echo '<a href="' . tep_href_link('cycle-carriers.php?my_own_listing=5') . '"><img src="images/cyclecarriers.jpg" border="0" alt="Thule Cycle Carriers" /></a>' ?> Thanks again Paul
Guest Posted April 13, 2007 Posted April 13, 2007 Paul, Try this - use the "advanced search" on your site. Select the manufacturer, and search. The URL that is seen on this advanced search page should do the trick! Further more, you can alter how the results look by copying the results page (code), and renaming it (search_results2.php would do!). Be sure to use the same naming scheme in your URL... Make sense!? Hope this helped. ;)
Dennis_gull Posted April 13, 2007 Posted April 13, 2007 As long as you have cookies enabled your customers wont lose the cart. If its just a standard ("stuck") link you shouldnt need to use the vars from the URL as you would just be able to pull the data right away from a sql statement on the other page. '<a href="' . tep_href_link('cycle-carriers.php'). '">' . tep_image_button('<your image>', <button name>) . '</a>'' ?> something like this should work: select * from <your table> where my_own_listing = 5 order by....
Guest Posted April 13, 2007 Posted April 13, 2007 Paul,Try this - use the "advanced search" on your site. Select the manufacturer, and search. The URL that is seen on this advanced search page should do the trick! Further more, you can alter how the results look by copying the results page (code), and renaming it (search_results2.php would do!). Be sure to use the same naming scheme in your URL... Make sense!? Hope this helped. ;) Hello Dlavache and Dennis Funnily enough I was thinking of doing the advanced search thing in the first place. I guess my main question boils down to if I use a link URL like this: advanced_search_result.php?search_in_description=1&keywords=thule+carrier+cycle&image.x=0&image.y=0 Can I then use this method to generate the link? <?php echo '<a href="' . tep_href_link('advanced_search_result.php?search_in_description=1&keywords=thule+carrier+cycle&image.x=0&image.y=0') . '"><h2>Cycle Carriers</h2></a>' ?> Does the fact that their is already a ? in the link I'd be using not cause problems when osCommerce trys to add the ?osCsid=. I'm a bit of a nood when it comes to these issues I'm afriad. BTW I may or may not settle on the search method of generating the list of products but It helps to illustrate my main concern. Thanks for all the help so far. Paul
Recommended Posts
Archived
This topic is now archived and is closed to further replies.