I try to pass datas from admin to front like :
WC()->frontend_includes();
WC()->session = new WC_Session_Handler();
WC()->session->set('datas', array(
'_email' => "email_here"
));
And retrieve them in front. For example here :
function action_woocommerce_before_checkout_form($wccm_autocreate_account)
{
$datas = WC()->session->get('datas');
var_dump($datas);
}
add_action('woocommerce_before_checkout_form', 'action_woocommerce_before_checkout_form', 10, 1);
add_action('woocommerce_before_cart_contents', 'action_woocommerce_before_checkout_form', 10, 1);
When I var_dump $datas in admin, I see my values but not on front
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…