Show content depending on sub-category's parent category name or slug?


How do I do if I want to show a div box depending on a sub-category’s parent category name or slug? I’m looking for something like this:

if parent_category_slug = books {
echo '<div class="div_book">';

I’m a terrible coder (as you can see on the code above) and I have never worked with MarketPress before. What I want the code to do is to show the div box if the parent category slug is “books”. I hope you’ll understand what I mean and that someone are able to help me.

Regards, Simon