// Add a product custom field "grams_quantity" that will update the displayed priceadd_action('woocommerce_before_add_to_cart_button', 'special_product_by_grams', 25);function special_product_by_grams(){ global $product; // HERE ...
// Add a product custom field "grams_quantity" that will update the displayed priceadd_action('woocommerce_before_add_to_cart_button', 'special_product_by_grams', 25);function special_product_by_grams(){ global $product; // HERE ...