This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* SOURCE: https://stackoverflow.com/questions/52937409/create-programmatically-a-product-using-crud-methods-in-woocommerce-3 | |
*/ | |
/* THE CODE FUNCTION */ | |
// Custom function for product creation (For Woocommerce 3+ only) | |
function create_product( $args ){ | |
global $woocommerce; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
$('body').on( 'click', '.some-button', function(){ | |
$.ajax( ajax_endpoint_data.api_url, { | |
type : 'POST', | |
dataType : 'json', | |
data : { | |
action: 'ajax_action', | |
some_data: 'some_value' | |
} |