[Resolved] Custom fields and WooCommerce

Home Forums Support [Resolved] Custom fields and WooCommerce

Home Forums Support Custom fields and WooCommerce

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #229785
    Thierry

    Hello,

    I use ACF and this plugin : https://wordpress.org/plugins/loushou-acf-for-woocommerce/

    Ok for the back-office but how i display in front, wath’s the hook ?

    Thx

    #229809
    Tom
    Lead Developer
    Lead Developer

    Where are you trying to display your field?

    #229817
    Thierry

    In the content with GP hooks “Inside Content Container”

    but i think that is not the god thing with Woocommerce

    #229985
    Tom
    Lead Developer
    Lead Developer

    Should work fine inside WooCommerce – that hook exists.

    What are you adding to it?

    #230115
    Thierry

    A pdf file for download.

    How i can work with the hook WooCommerce ? i use GP hooks or i copy a template of WooCommerce and i modify single-product.php ?

    #230142
    Tom
    Lead Developer
    Lead Developer

    You can use GP Hooks, this would only show on WooCommerce templates for example:

    <?php if ( function_exists( 'is_woocommerce' ) ) :
    if ( is_woocommerce() ) { ?>
        Text here will only show on WooCommerce pages
    <?php }
    endif; ?>
    #230563
    Thierry

    Thank you Tom.

    Have you the same help for the WooCommerce pages ?

    http://demo.generatepress.com/hook-locations/

    #230666
    Tom
    Lead Developer
    Lead Developer

    All of those hooks apply to WooCommerce as well as any other page.

    The code I provided above will make it so any code inside it will only apply to WC pages.

    #230680
    Thierry

    But i don’t found how i can write on my page product

    see the image :

    [URL=http://www.hostingpics.net/viewer.php?id=84662328GP.jpg][IMG]http://img15.hostingpics.net/thumbs/mini_84662328GP.jpg[/IMG][/URL]

    #230788
    Tom
    Lead Developer
    Lead Developer

    Ah, you’ll have to ask WooCommerce if an action (hook) exists there.

    If it does, you’ll need to write the function, as only GP hooks are available in GP Hooks.

    This should help when it comes to writing a function: https://generatepress.com/knowledgebase/hook-list/

    #230847
    Thierry

    I understand, thank you Tom

    #230934
    Tom
    Lead Developer
    Lead Developer

    No problem 🙂

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.