How do I show ACF (Advanced custom fields) in frontend of single product page?

This topic has 4 replies, 2 voices, and was last updated 1 years, 7 months ago ago by Rose Tyler

  • Avatar: Shubh
    Shubh
    Participant
    May 8, 2023 at 07:02

    I have a created a few custom fields using ACF (Advanced custom plugin) for single product page. Now how do I show them in frontend? I am using Xstore Business child theme. I researched they all are saying i write a short code somewhere, i don’t know where?

    3 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 8, 2023 at 10:33

    Hello, Shubh,

    Thank you for contacting us and for using XStore.

    Please check this topic https://www.8theme.com/topic/which-file-to-edit-to-put-acf-in-category-page/
    Describe your situation and the desired result in more detail.
    Provide URL of your Shop page or product and temporary wp-admin access.

    Kind Regards,
    8theme team

    Please contact administrator
    for this information.
    Avatar: Shubh
    Shubh
    Participant
    May 8, 2023 at 11:15

    Hey there, so, I want to add my existing developers on my website for my clients to see directly. The best way to do that is to use Woocommerce products as Developers, and categories as Tech categories, and tags as other skillsets. I want to add a few functionalities in WooCommerce product edit page and show them to frontend. Now I don’t know which file to edit, everyone on internet keep saying that edit single product php file, but i can’t find it.

    Rate- xx/hour
    Experience-
    Availability-
    Skills-

    Also, see the private content area.

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 8, 2023 at 15:59

    Hello, Shubh,

    Thank you for your response.

    This is a matter of additional customization – which you can do on the resource – https://wpkraken.io/ .

    If you want to do it yourself, the modification greatly depends on whether you use the single product builder. If you are using it, then you need to learn WooCommerce’s hook system, some of which you can check out by following the link – https://www.businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/

    If you are not using the builder, in addition to hook, depending on the customization, you will also need to rewrite some of the following files in the child theme
    wp-content\themes\xstore\woocommerce\single-product\product-image.php
    wp-content\themes\xstore\woocommerce\single-product\related.php
    wp-content\themes\xstore\woocommerce\single-product\title.php
    wp-content\themes\xstore\woocommerce\single-product\up-sells.php
    wp-content\themes\xstore\woocommerce\single-product\bought-together.php
    wp-content\themes\xstore\woocommerce\single-product\meta.php
    wp-content\themes\xstore\woocommerce\single-product\add-to-cart\simple.php
    wp-content\themes\xstore\woocommerce\single-product\tabs\single-product-builder-tabs.php
    wp-content\themes\xstore\woocommerce\single-product\tabs\tabs.php

    In order to take the value of the option added to the product using the ACF (Advanced custom fields) plugin
    you can use the following code
    get_field(‘your option kay’, $id);
    where $id is the ID of the product on which the code is executed

    it is also desirable to use construction
    $value = (function_exists(‘get_field’) ) ? get_field(‘your option kay’, $id) : ‘default value’;
    to prevent errors when disabling or updating the ACF (Advanced custom fields) plugin.

    We hope this information is helpful.

    Please note that additional customization in files is outside the scope of our basic support. Also, we can’t be responsible for your custom coding.

    Kind Regards,
    8theme team

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.