Skip Navigation

[Resolved] Second description product archive page

This support ticket is created 4 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 10 replies, has 2 voices.

Last updated by mauritsH-2 4 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#1291039
Screenshot 2019-07-13 at 22.58.02.png

Tell us what you are trying to do?
Second description under the products of an product category archive page
--
Hi, I would like to add a second desctription to my product archive pages. I found some articles of Toolset and other pp about it but coulnd't find the solution with toolset. Honestly this would mek toolset the perfect plugin for me.
As you can see on the archive page i fo have already tekst below my products. unfortunately with the code of businessbloomer (see below) the text comes between the products and the "next page" numbers.

I would like to design it in the way as the attached screenshot. So i tried already to make a custom fiels but this isn't working?? I thought this should be the solution? Guys if this is possible you will make my week!!

Is there any documentation that you are following?
hidden link

Is there a similar example that we can see?
hidden link

What is the link to your site?
hidden link

#1291441

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Do you mean that you want to display the second description box just after the first description displayed?

I would like to know - did you used Types custom field to create the second description field?

Can you please tell me where exactly you want to display the second description with problem URL and access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1294761

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

This is not a Toolset issue but still I found something that will help you.

The second description you added is displayed after all products displayed because you added the hook:

add_action( 'woocommerce_after_shop_loop', 'bbloomer_display_wp_editor_content', 5 ); 
function bbloomer_display_wp_editor_content() {
   if ( is_product_taxonomy() ) {
	   
    $term = get_queried_object();
      if ( $term && ! empty( get_woocommerce_term_meta( $term->term_id, 'seconddesc', true ) ) ) {
         echo '<p class="term-description">' . wc_format_content( htmlspecialchars_decode( get_woocommerce_term_meta( $term->term_id, 'seconddesc', true ) ) ) . '</p>';
      }
   }
}

If you will just switch the hook to:

add_action( 'woocommerce_before_shop_loop', 'bbloomer_display_wp_editor_content', 5 );

The second description will be displayed before all products displayed.

Please check the following reference. The following page will help you to decide what hook you need to use:
=> hidden link

#1296071

Hi Minesh,

Sorry, i think my explanation wasn't good...

So at the moment i have integrated the second description with that code from businessbloomer.com. But i want to integrate it with the Toolset plugin and delete the businessbloomer.com code.

Basically i want to create a custom text field for the product category. I want to call this text field "second description" and then with the Elementor builder i want to implement the field dynamically (query: category) Below the products.

So the setup will be:
-------------------------------------------------------- menu ----------------------------------------------------------

------Featured image--------|-------------- Category titel----------------------------------------------------
|-------------- Short description ---------------------------------------------

----------------------------------------------------------------------------------------------------------------------------

------Sidebar------------------- | Product field (alle products in the category)

------------------------------------------------------------------------------------------------------------------------------

Second description (made with the toolset field)

------------------------------------------Footer----------------------------------------------------------------------------

Hope that my beautiful drawing is giving a good overview :).

If i can make it more clear please let me know.

Thanks for your effort!

#1296101

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

To add custom term field to your taxonomy, please try to follow the following Doc:
=> https://toolset.com/documentation/user-guides/term-fields/

To display it you should use the same hook which you are using currently:

add_action( 'woocommerce_after_shop_loop', 'bbloomer_display_wp_editor_content', 5 ); 

Where you just need to change the custom term field name you will create using Types.

#1296231
Screenshot 2019-07-19 at 16.28.42.png

Thank you for the patience. I got the field!!!

I'm almost there i think. I only need to display it now on the archive field.
So i have designed this product category with Elementor. Normally i can just add below the products a row ->
Then add an tekst field -> dynamic content -> Toolset Field -> Key "the field i want to display".

I don't see this field name (as on the picture).

Is there another way to display this field?

Thanks

#1296311

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What if you use the same code you had added and just change the field name with the newly field name you created with Types.

For example:

add_action( 'woocommerce_after_shop_loop', 'bbloomer_display_wp_editor_content', 5 ); 
function bbloomer_display_wp_editor_content() {
   if ( is_product_taxonomy() ) {
        
    $term = get_queried_object();
      if ( $term && ! empty( get_woocommerce_term_meta( $term->term_id, 'seconddesc', true ) ) ) {
         echo '<p class="term-description">' . wc_format_content( htmlspecialchars_decode( get_woocommerce_term_meta( $term->term_id, 'wpcf-uitgebreide-tekst-2', true ) ) ) . '</p>';
      }
   }
}

Does this help? As you can see I've added the Types field "wpcf-uitgebreide-tekst-2".

#1298849
Screenshot 2019-07-23 at 21.39.40.png

Hi Minesh,

Sorry for my late respons. The code works yes. Thats great!
So yes i do have now displayed a second description made with the Toolset plugin.

But as you can see on the page (hidden link) is that the text is still in between of the product and the pagination.

It would be sooo perfect if i would be able to implement a dynamic field like with the first description and the featured image. I want to display this exactly like the first image i've send with.

So like this:
I go to my Elementor builder for the archive page (dynamically set up).
Then i add below the products a new row.
In this row i add a text part.
-> I add a dynamix field
-> Choose for: Toolset field
-> Go to settings -> Key -> Choose te toolset field.
Over here i want to choose the "wpcf-uitgebreide-tekst-2".
(see image)

In this way i will be able to display it the perfect way!! Would be great if you have the solution for this 😀

#1298943

Is it maybe possible otheriwse to generate a shortcode that will dynamically display the text?

#1299151

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

At the moment, you can display term fields on a View listing terms and on a term archive page.

What if you try to use the following code:

[types termmeta="uitgebreide-tekst-2"][/types]

More info:
=> https://toolset.com/documentation/user-guides/displaying-wordpress-term-fields/#displaying-term-fields-with-views-without-writing-any-code

#1299347

Minesh you are a hero. My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.