longhorn1999 Posted April 16, 2011 Share Posted April 16, 2011 Hi, I've been going through the text in my site to make sure that all the links are written correctly, and I see that there's one thing which I'm not quite sure about. To make a regular link to a category for example might be: <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=30'); ?>">Televisions</a> And the link for the subcategory LCD TVs might be: <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=30_31'); ?>">LCDs</a> And the link for all products of the manufacturer, Sony, would be: <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=27'); ?>">Sony</a> But if I wanted to only show Sony LCDs instead of all Sonys, what would be the proper syntax? I'm using Ultimate SEO Urls 5, and the page url for this product listing would be http://www.somesite.com/sony-m-27.html?filter_id=31&sort=2a Any ideas? Link to comment Share on other sites More sharing options...
Hotclutch Posted April 17, 2011 Share Posted April 17, 2011 Use <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=31'); ?>">LCDs</a> Instead of <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=30_31'); ?>">LCDs</a> Link to comment Share on other sites More sharing options...
longhorn1999 Posted April 17, 2011 Author Share Posted April 17, 2011 Thanks Ashley. You're right, I can just use the subcategory id the same as the category id. But any ideas about how to link to specific subcategories and manufacturers together? Link to comment Share on other sites More sharing options...
Hotclutch Posted April 17, 2011 Share Posted April 17, 2011 Thanks Ashley. You're right, I can just use the subcategory id the same as the category id. But any ideas about how to link to specific subcategories and manufacturers together? Try using filter_id. You can turn it on in admin. Link to comment Share on other sites More sharing options...
longhorn1999 Posted April 19, 2011 Author Share Posted April 19, 2011 Could you tell me where filter_id is exactly in the admin? I can't seem to find it in mine. Link to comment Share on other sites More sharing options...
Hotclutch Posted April 19, 2011 Share Posted April 19, 2011 Could you tell me where filter_id is exactly in the admin? I can't seem to find it in mine. Configuration - product listing. Link to comment Share on other sites More sharing options...
longhorn1999 Posted May 4, 2011 Author Share Posted May 4, 2011 Thanks again Ashley. Actually I have filter_id set to enable in the admin. I'm still trying to figure out the proper syntax for, in this example, only Sony LCDs as opposed to any other brand. Here the LCD category has the id 31 and the manufacturer Sony has the id 27. This is the syntax of the actual url w/ Ultimate SEO Urls 5: http://www.example-TV-store.com/LCDs-c-31.html?filter_id=27&sort=2a Is there a way to create a tep_href link that takes me to this specific page, i.e., the LCD category listing that has been filtered to just the one manufacturer, Sony? Link to comment Share on other sites More sharing options...
Hotclutch Posted May 4, 2011 Share Posted May 4, 2011 Have you tried <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'filter_id=31'); ?>">Sony LCDs</a> Link to comment Share on other sites More sharing options...
longhorn1999 Posted May 4, 2011 Author Share Posted May 4, 2011 Just tried it and unfortunately it doesn't work, as it just takes me back to the home page. <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=27'); ?>">Sony</a> is what's there right now, and this returns all Sony products. I would've thought that the way to filter this with category 31 (LCDs) would be something like <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=27, filter_id=31'); ?>">Sony LCDs</a> but of course that doesn't work. Somehow the manufacturer id 27 and the category id 31 should both be included, but I don't know what the proper syntax is. Link to comment Share on other sites More sharing options...
Hotclutch Posted May 5, 2011 Share Posted May 5, 2011 There are 5 parameters for tep href function. tep_href_link($page, $parameters , $connection, $add_session_id , $search_engine_safe ) $page is the page you are linking to. $parameters is parameters for the url (action=send etc) $connection is SSL or NONSSL $add_session_id is normally 'true' so sid is added $search_engine_safe if set to true and SEARCH_ENGINE_FRIENDLY_URLS is set to 'true' (in admin) sef url's are created. http://www.oscommerce.com/forums/topic/330479-what-is-the-oscsid-why-you-must-not-loose-it/ eg: <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=27', 'NONSSL'); ?>">Sony</a> So how you suggested it won't work. (don't think you can specify multiple parameters). Link to comment Share on other sites More sharing options...
longhorn1999 Posted May 5, 2011 Author Share Posted May 5, 2011 Hmm.. Very useful info for sure, thanks. But I guess I'm still stuck for now. I am surprised that there doesn't appear to be a way to add a manufacturer or category filter to a tep_href link. Has no one else seen a use for these kind of specific links in their site, or is it simply not possible? I suppose just forcing cookie use and forgetting tep_href links altogether is the other option. Link to comment Share on other sites More sharing options...
longhorn1999 Posted May 5, 2011 Author Share Posted May 5, 2011 OK I just got the answer for future reference from Robert (FWR Media) in another thread. This link in my example would look like: tep_href_link( FILENAME_DEFAULT, 'cPath=31&filter_id=27&sort=2a' ) Link to comment Share on other sites More sharing options...
Hotclutch Posted May 5, 2011 Share Posted May 5, 2011 OK I just got the answer for future reference from Robert (FWR Media) in another thread. This link in my example would look like: tep_href_link( FILENAME_DEFAULT, 'cPath=31&filter_id=27&sort=2a' ) This also works tep_href_link( FILENAME_DEFAULT, 'manufacturers_id=10&filter_id=657' Link to comment Share on other sites More sharing options...
longhorn1999 Posted May 5, 2011 Author Share Posted May 5, 2011 Nice! I knew there was some simple solution to this...the ampersand! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.