Hello!
Try to add custom field to product category pages.
Read topics:
http://support.advancedcustomfields.com/forums/topic/custom-field-on-category-pages/
http://support.advancedcustomfields.com/forums/search/woocommerce/page/2/
http://www.advancedcustomfields.com/resources/how-to/how-to-get-values-from-a-taxonomy-term/
Did the same things, field apply to the category page, but on the main product page (catalog) I get the error
“Catchable fatal error: Object of class stdClass could not be converted to string in /wp-content/plugins/advanced-custom-fields/core/api.php on line 23”
Hi @igooner!
I’ve the same issue.
Have you solve it?
Hi!
Yep, I have solved it.
I had to add 2nd description on category pages, so I created custom field ‘second_description’ and put this code (below) at the file woocommerce file ‘archive-product.php’
<?php
// vars
$queried_object = get_queried_object();
$taxonomy = $queried_object->taxonomy;
$term_id = $queried_object->term_id;
// load desc for this taxonomy term (term object)
$sec_descrip = get_field(‘second_description’, $queried_object);
// load desc for this taxonomy term (term string)
$sec_descrip = get_field(‘second_description’, $taxonomy . ‘_’ . $term_id);
?>
<div class=”term-description”><?php the_field( ‘second_description’, $queried_object ); ?></div>