Categories
CMS Mastering Development Wordpress

WooCommerce with ACF: custom fields per product variation

I’m a little stuck here. So I have variable products and I need to show the output of a custom field in a custom tab. So I created a new field in ACF, called ‘test’. I’ve got this to work for the product itself, but the content does not change when I select another variable. […]

Categories
CMS Mastering Development Wordpress

Custom Field for Woo variation, Product page ok, But cart page not working. Help me, Please

<?php /* Plugin Name: Woocommerce Custom Field Plugin URI: # Description: Test Mode Version: 1.0 Author: Test Author URI: # */ // Add Variation Custom fields // Aggiunte campi asseverazione, legalizzazione Variazioni nel backend add_action( ‘woocommerce_variation_options_pricing’, ‘add_variation_options_pricing_assev’, 10, 3 ); function add_variation_options_pricing_assev( $loop, $variation_data, $variation ){ woocommerce_wp_text_input( array( ‘id’ => ‘_assev_’.$loop, ‘wrapper_class’ => ‘form-row form-row-first’, […]

Categories
CMS Mastering Development Wordpress

Code to Update Prices and add them for Woocommerce Custom Product Variations Loop

I am actually struggling with some custom functions. Actually My aim is the following: Create 2 custom fields in a woocommerce variable product backend ✔ Show these custom fields text and prices in frontend Make able to add the product in the cart with these prices summed up. I don’t know which hook I am […]

Categories
Mastering Development

Second price in WooCommerce variable product

We have added second price for variable products with this code and it works just fine. // Backend Variation – Add / Display MRSP Field add_action( ‘woocommerce_variation_options_pricing’, ‘add_variation_options_pricing_msrp’, 10, 3 ); function add_variation_options_pricing_msrp( $loop, $variation_data, $variation ){ woocommerce_wp_text_input( array( ‘id’ => ‘_msrp_’.$loop, ‘wrapper_class’ => ‘form-row form-row-first’, ‘class’ => ‘short wc_input_price’, ‘label’ => __( ‘Цена за […]

Categories
CMS Development Wordpress

Display variation custom field value

I’m using the following function to add a custom field called “price_1_50” to each product variation: add_action( ‘woocommerce_variation_options_pricing’, ‘bbloomer_add_custom_field_to_variations’, 10, 3 ); function bbloomer_add_custom_field_to_variations( $loop, $variation_data, $variation ) { woocommerce_wp_text_input( array( ‘id’ => ‘price_1_50[‘ . $loop . ‘]’, ‘class’ => ‘short’, ‘label’ => __( ‘Price 1-50:’, ‘woocommerce’ ), ‘value’ => get_post_meta( $variation->ID, ‘price_1_50’, true ) […]

Categories
Development WooCommerce Wordpress

Replacing Custom field id in woocommerce

I want to add a custom field in the woocommerce product edit page. Based on my search I got below code but I want to fit values as below. I am looking to change the value in the below code to: id – variation_title Label – Variation Title I tried modifying the code and the […]