Skip to content

Instantly share code, notes, and snippets.

@gicolek
Created November 23, 2013 20:57
Show Gist options
  • Save gicolek/7619866 to your computer and use it in GitHub Desktop.
Save gicolek/7619866 to your computer and use it in GitHub Desktop.
Woo Commerce custom add to cart ajax handler
<?php
add_action( 'woocommerce_ajax_added_to_cart', 'ac_add_product_custom_field' );
/**
*
* @hook woocommerce_ajax_added_to_cart
*/
function ac_add_product_custom_field($product_id) {
// check if logo_text has been defined by the client
if ( isset( $_POST['logo_text'] ) ) {
// do something
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment