Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

Foxyshop Conditional Cateory Title

yoayoa Member
in General edited October 2013

Hello,

Im using foxyshop and on foxyshop_single-category.php

On line 26, I added the word "Organic" so that it would display that word berore all the category titles on the category pages.. and it worked well except on a couple of the category pages.. I would like to "NOT" have the word Organic before the category title.

----


Here is what the line in question looked like originally
//Write Category Title
	
echo '<h1 id="foxyshop_category_title">' . str_replace("_","",$currentCategoryName) . '</h1>'."\n";




Here is what it looked like after i added the word organic ..

//Write Category Title
	
echo '<h1 id="foxyshop_category_title"> Organic ' . str_replace("_","",$currentCategoryName) . '</h1>'."\n";




So my question is, How can the line above be written so that its conditional or only for certain category page titles? I have one or two categorys that i need to "not" have the prefix of organic in the title names.




Thanks in advance,
Yoa
Tagged:
Comments
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    @Yoa, I think this just comes down to a bit of PHP creativity. Maybe something like this?
    $blacklisted_page_titles = array("Cat 1", "Cat 2");
    if (in_array($currentCategoryName, $blacklisted_page_titles)) {
    	$organic_title = "";
    } else {
    	$organic_title = "Organic ";
    }
    echo '<h1 id="foxyshop_category_title"> ' . $organic_title . str_replace("_","",$currentCategoryName) . '</h1>'."\n";
    

    *I didn't test this so I may have made some dreadful syntax error - but this will give you an idea of what I had in mind*
  • yoayoa Member
    Sparkweb! Thanks so much!!! It works great!

    I just recently started documenting all the foxyshop tidbits that have worked for me a surely this will get added to the list.


    Thanks again, your a gem!



    Best Regard,
    Yoa
Sign In or Register to comment.