I am using Wordpress and I have set up a shop in woocommerce. I am trying to display brand name as link on product page and I am having difficulties with the code. So far, I have:
<?php $brands = wp_get_post_terms( $post->ID, 'product_brand', array("fields" => "all") );
echo "Brend: ";
foreach( $brands as $brand ) {
$url = get_term_link( $brand->slug, 'product_brand' );
echo '<a href="' . $url . $brand->name '"></a>';
}?>
I get the following error:
Parse error: syntax error, unexpected ''">'' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';' in your code on line 6
I am not able to see what am i doing wrong. Any help would be highly appreciated.