Adding a button to a product if it’s in a category, then linking to that category

EDIT

From your comments, you are using get_cat_ID() totally wrong. You can only feed one category to it. Please follow all links given and check the examples in the codex. Also, as stated, enable debugging, because that is all problems you should have picked up

Secondly, it seems that you are using a custom taxonomy and not the build in category structure, in which case, none of the suggestions in my original answer will work. Please check out this post I’ve done on what the difference is between categories and custom taxonomies

I don’t have time to code now (I also don’t really understand what exactly you want), but here are links you should check out from the codex and follow the examples given on these pages.

ORIGINAL ANSWER

I don’t believe that your code worked at all. You have a couple of errors here

Before I step right into the errors, please see Debugging_in_WordPress as most problems should have been solved with debug turned on

Now, for the errors

$category

(mixed) (required) One or more categories specified by ID (integer), name or slug (string), or an array of these

Default: None

  • Never hardcode any URL’s into a theme or plugin. Make use of relative or absolute paths where appropriate. The problem with hardcoding is that a theme or plugin cannot be used on other domains by default

  • When you are using get_the_category(), you actually have to set a value for $id. Just simply adding $id will result in an undefined variable notice. You can either leave it blank, supply an actual post ID or use $post->ID to use the current post ID (which is the default btw, so no need to do that, just leave it blank)

  • To get the URL (link) to a category page, make use of get_category_link()

You can probably try something in the line of: (Samples from the codex)

if( in_category( 'ID, name or slug of the category' ) && in_the_loop() ) {
   // Get the ID of a given category
   $category_id = get_cat_ID( 'Category Name' );

   // Get the URL of this category
   $category_link = get_category_link( $category_id );
?>

<!-- Print a link to this category -->
<a href="<?php echo esc_url( $category_link ); ?>" title="Category Name">Category Name</a>

<?php
}else{
    //displays nothing
}