This file contains hidden or 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
//Hi, i created a function for adding variable products based on your code. I share it here in case anyone needs it: | |
//The first parameter is the title of the product, $cats is the products category id which has to be an array and must be created previously, $variations is an array which contains the variations with prices, descriptions, discount, and $variations_key is the key of the parent attribute which has to be created previously on teh attributes page. | |
//I´m creating a ticket´s selling store and I´m using 2 globals: $logger and $vgh from my framework, please ignore them. | |
<? | |
function create_variable_woo_product($title, $cats = array(), $variations, $variations_key) { | |
global $wpdb, $logger, $vgh; |