HomePage › Forums › Themes Support › Freshio – Organic & Food Store WordPress Theme › Showing additional info to Products list
- This topic has 10 replies, 2 voices, and was last updated 2 years, 2 months ago by Billy Nguyen.
-
AuthorPosts
-
January 24, 2022 at 12:34 am #19547uzzy33Support Expired
Hi,
i would like to add Tags text into the Products list,
like the second table on this webpage : https://madconsulting.ch/negozio/Thanks a lot
January 24, 2022 at 8:16 am #19550Do you mean to display more this list in category product page? https://ibb.co/8MQrjyp
This customization is not currently available, we will custom charge you if you would like to add this customization. However, you need to be more specific about this requirement
January 26, 2022 at 5:42 pm #19630uzzy33Support Expiredin simply terms i would like to add tag info to all the products of the list beetween the title and the price on your widget.
January 26, 2022 at 6:09 pm #19632uzzy33Support ExpiredI found the part i would like to change : content-widget-product.php (adding the tag information for any product )
<div class=”product-content”> <?php do_action( ‘freshio_product_list_content_before’ ); ?> get_permalink() ); ?>”><span><?php echo wp_kses_post( $product->get_name() ); ?></span> <?php do_action( ‘freshio_product_list_title_after’ ); ?> <?php if ( ! empty( $show_rating ) ) : ?> <?php echo wc_get_rating_html( $product->get_average_rating() ); // PHPCS:Ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php endif; ?> <span class=”tag”> <?php echo freshio_product_get_tag_html( $product ); // PHPCS:Ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </span> <span class=”price”> <?php echo freshio_product_get_price_html( $product ); // PHPCS:Ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </span>
- This reply was modified 2 years, 2 months ago by Billy Nguyen.
January 27, 2022 at 12:55 pm #19668No, you need to add the following code to your functions.php file (child-theme):
add_action('woocommerce_after_shop_loop_item_title', 'freshio_fnc_custom_add_tags', 1); function freshio_fnc_custom_add_tags(){ <span class="tag"> <?php echo freshio_product_get_tag_html( $product );> </span> }
January 27, 2022 at 6:17 pm #19681uzzy33Support ExpiredThanks seems there is some error in your code i’ve tried to correct it but i’m facing a lot of issue,
`add_action(‘woocommerce_after_shop_loop_item_title’, ‘freshio_fnc_custom_add_tags’, 1);
function freshio_fnc_custom_add_tags(){ ?>
<span class=”tag”>
<?php echo freshio_product_get_tag_html( $product );
?>
</span>
<?php
}Example : https://madconsulting.ch/negozio/
January 27, 2022 at 6:30 pm #19682uzzy33Support ExpiredFatal error: Uncaught Error: Call to undefined function freshio_product_get_tag_html() in /home/clients/4c49faf600e954852d23481dedc670cc/sites/tilog.ch/wp-content/themes/freshio-child/functions.php:69 Stack trace: #0 /home/clients/4c49faf600e954852d23481dedc670cc/sites/tilog.ch/wp-includes/class-wp-hook.php(307): freshio_fnc_custom_add_tags(”) #1 /home/clients/4c49faf600e954852d23481dedc670cc/sites/tilog.ch/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(”, Array) #2 /home/clients/4c49faf600e954852d23481dedc670cc/sites/tilog.ch/wp-includes/plugin.php(474): WP_Hook->do_action(Array) #3 /home/clients/4c49faf600e954852d23481dedc670cc/sites/tilog.ch/wp-content/plugins/woocommerce/templates/content-product.php(57): do_action(‘woocommerce_aft…’) #4 /home/clients/4c49faf600e954852d23481dedc670cc/sites/tilog.ch/wp-includes/template.php(772): require(‘/home/clients/4…’) #5 /home/clients/4c49faf600e954852d23481dedc670cc/sites/tilog.ch/wp-content/plugins/woocommerce/includes/wc-core-functions.php(284): load_template in /home/clients/4c49faf600e954852d23481dedc670cc/sites/tilog.ch/wp-content/themes/freshio-child/functions.php on line 69
January 27, 2022 at 6:30 pm #19683uzzy33Support Expiredthe child line functions.php on line 69 : freshio_product_get_tag_html( $product );
January 28, 2022 at 2:15 pm #19706Oh sorry,
Please go to Cpanel and fix this code to:
add_action('woocommerce_after_shop_loop_item_title', 'freshio_fnc_custom_add_tags', 1); function freshio_fnc_custom_add_tags(){ global $product; ?> <?php echo wc_get_product_tag_list( $product->get_id(), ', ', '<span class="tagged_as">' . _n( 'Tag:', 'Tags:', count( $product->get_tag_ids() ), 'woocommerce' ) . ' ', '</span>' ); ?> }
January 28, 2022 at 3:18 pm #19712uzzy33Support ExpiredThanks a lot Billy,
U re the Man!February 3, 2022 at 9:58 am #19766Ok, let me know if you need to help and hope you will vote 5 stars for our team.
-
AuthorPosts
You must be logged in to reply to this topic.