Post by c0rdii » Thu Aug 01, 2013 10:54 am

Hi,

I am hard coding a few custom pages in Opencart, and I am creating some filtered links.

For example:

http://quotespot.com.au/product/search& ... ory_id=275


I am manually hardcoding these types of links, BUT, i do not want to find the category_id each time, as I have a list of the filter_names and the category names i would like to filter by.

Is there a way I can get the category_id by providing the category name to match?


eg. of my code

Code: Select all

<?php

$catArray = array("pgh-bricks","bowral-bricks");
$multicatArray = array(
					 $catArray[0]=>array("solid","townhouse","summervilla"),
					 $catArray[1]=>array("common","dry-pressed","special-shapes")
					);
?>

/*URL BELOW*/
<a href = "product/search&filter_name=<?php echo $multicatArray[$catArray[$i]][$b]; ?>&filter_category_id=<?php echo $catArray[$i]; ?>">
NOTE: Ignore the $i and $b's as they are loop variables.

Any help would be much appreciated!!

Newbie

Posts

Joined
Wed Mar 21, 2012 7:10 pm
Who is online

Users browsing this forum: No registered users and 1 guest