You are here:  » Just brand and product model name

Active Forum Topics

Just brand and product model name

Submitted by searchs on Wed, 2016-10-26 11:17 in

I run {link saved} and will like the product name displayed as just brand and model or just the brand. Anyone done this before? Example of results: {link saved}

Submitted by support on Wed, 2016-10-26 12:23


Sure - I assume that you have added `model` as a custom field - so in your html/searchresults.php look for where the product name is displayed using something like:

<?php print $product["name"]; ?>

...and REPLACE with:

<?php print $product["brand"].($product["model"]?" ".$product["model"]:""); ?>

This part of the replacement:

($product["model"]?" ".$product["model"]:"") called a "ternary", and is basically a short-hand version of an if / else construct, so in this case, if $product["model"] is populated, it is appended, with a space, to the brand.

Hope this helps!