Hi,

Originally Posted by
simon1066
if ($hide == 'blue'){
$show_product_filter = true;
} else {
$show_product_filter = false;
}
The trouble is the uri's are actually /united-states/blue ...etc.
so using the == isn't correct. I'm just not sure what to use instead
This is a PHP programming question, it's nothing to do with this thread really.
To answer your question specifically, you could simply check against the last part of the URI that you have identified as wanting to match.
You'd just extract the last part. Here's how to extract it from a string stored in "$uri"
PHP Code:
$last_slash_pos = strrpos($uri, '/');
$last_uri_part = substr($uri, $last_slash_pos + 1, strlen($uri) - ($last_slash_pos + 1));
if ($last_uri_part == 'blue') {
However, your code is wrong, it will match Category URIs, Product URIs or EZ-Page URIs as you haven't limited the range of the page "types" that can use an associated_db_id.. the first one in the database with the ID of whatever the cPath is will match:
PHP Code:
$hide_filter = "select uri
from " . TABLE_CEON_URI_MAPPINGS . " cm
where current_uri = '1'
and cm.associated_db_id = '" . (int)$_GET['cPath'] . "'";
You'd be better off building the URI using the Ceon URI Mapping functionality, which can be easily instigated through a call to zen_href_link():
PHP Code:
$parameters = 'cPath=' . $cPath;
$uri = zen_href_link(FILENAME_DEFAULT, $parameters);
As this is a very specific/personal programming question, it wouldn't be appropriate to reply here, please instead start a new thread.
All the best...
Conor
ceon
Bookmarks