The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

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.