No, i’m talking about adding ACF fields inside the order itself. But this ACF fields i have created them as Post Type = Product (Woocommerce) and i want to display some of them inside the order.
Hi i want to do something similar. I have a acf input field called “contado_en_local” and i want to replace the woocommerce regular price with it in the archive product page.
The problem is that the acf field appears, but above the title and i want it below, and also it didn’t removed the woocommerce default regular price.
Also i don’t how to style it. It is donde in the child-theme’s style.css?
I made a custom plugin called WOOCOMMERCE ALE BIANCHI and insert this code in wp-content/plugins/woocommerce-ale-bianchi-audioarte.
<?php
/*
Plugin Name: WOOCOMMERCE ALE BIANCHI
Plugin URI: https://rampcrosario.com
Description: Funciones personalizadas Woocommerce para AudioArte
Version: 1.0.0
Author: ALE BIANCHI
Author URI: https://rampcrosario.com
License: GPL 2+
License URI: https://rampcrosario.com
*/
//* Mostrar precio CONTADO creado con ACF en vez de DEBITO colocado en precio regular Woocommerce
add_action( 'after_setup_theme', 'ale_custom_shop_woocommmerce' );
function ale_custom_shop_woocommmerce () {
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
function ale_acf_precio() {
if(get_field('contado_en_local'))
{
echo '<p>' . get_field('contado_en_local') . '</p>';
}
}
add_filter( 'woocommerce_after_shop_loop_item_title', 'ale_acf_precio', 15 );
}