Answers for "woocommerce product name field php"

6

woocommerce get product id

global $product;
$product->get_id();
Posted by: Guest on July-03-2020
0

pass the product name to form field cf7 woocommerce

<button type="submit" value="<?php echo esc_attr( $product->get_id() ); ?>"
        class="single_add_to_cart_button button alt"><?php echo _e( 'Request', 'framework' ); ?></button>
<input type="hidden" name="product-id" value="<?php echo absint( $product->get_id() ); ?>" />
<input type="hidden" name="contact-subject" value="<?php echo esc_html( $product->get_title() ) ?>" />
Posted by: Guest on December-10-2020

Code answers related to "woocommerce product name field php"

Browse Popular Code Answers by Language