Home Forums WoodMart support forum Change template in product archive

Change template in product archive

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #401375

    Woodroof
    Participant

    Hello
    Please tell me where I can change or create a new template for the product archive (see screenshot 1) .
    Theme settings – Product archive – Product styles
    I added a new field “my_description” to the product (see screenshot 2) and would like to display this field in the product archive through a different template.

    Attachments:
    You must be logged in to view attached files.
    #401424

    Luke Nielsen
    Keymaster

    Hello,

    Sorry, but these custom fields functionality is not related to the theme so most likely it can not work properly.

    You can set the “Show summary on hover” product style that shows a product description so you can define this as a description and it will show on each archive page.

    https://prnt.sc/Ug-eEFBtsAqr

    Kind Regards

    #401605

    Woodroof
    Participant

    Hello
    I solved the issue by editing the template /wp-content/themes/woodmart-child/woocommerce/content-product-alt.php
    Sample copied from parent theme
    Created 2 parameters in the product “my_title” and “my_description”
    https://prnt.sc/Y-yjyy0a5ibo
    In the template got them through the code

    	$my_desc = get_post_meta(get_the_ID(),'my_description',true)?:''; 
    	$my_title = get_post_meta(get_the_ID(),'my_title',true)?:''; 
    

    Wrote the code, if “my_title” and “my_description” are set, then display them instead of the usual code
    Result
    https://prnt.sc/wmj_OL6Ty7cD

    #401620

    Luke Nielsen
    Keymaster

    Hello,

    Glad that you sorted it out.

    Always remember that you can reach out to us with any questions you may have.

    We wish you a splendid day!

    Kind Regards

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Change template in product archive’ is closed to new replies.