mardi 28 juin 2016

WooCommerce ACF Display custom meta data on Cart and Checkout page

I would like to show the value of my field created with Advanced Custom Fields plugin, also in the cart and checkout page of WooCommerce. I'm using the code below in the functions.php page of my theme, which displays only in the single page of the product:

add_action( 'woocommerce_before_add_to_cart_button', 'add_custom_field', 0 );

function add_custom_field() {
    global $post;

  echo "<div class='produto-informacoes-complementares'>";
  echo get_field( 'info_complementar', $product_id, true );
  echo "</div>";

    return true;
}

Thank you all in advanced for all the help given and excuse my english.



via Chebli Mohamed

1 commentaire:

  1. Looking for woocommerce Rest API Integration for your online store? Hire our developers & programmers for your custom API and extensions. +91-9806724185 or Contact@expresstechsoftwares.com

    RépondreSupprimer