Thanks man. Basically Here is what I have going on with this script I have a script that grabs each color and size available for a product which is listing in a .csv file column named "Color-:-Size~QTY" on one row. So we break this down using the following:
$Productcolor = #row from .csv file
$regexp = '#(?<=^|;)(\b.*\b)\s*-:-\s*(\b.*\b)\s*~\s*(\b.*\b)(?=;|$)#U';
preg_match_all($regexp, $Productcolor, $matches, PREG_SET_ORDER);
$colors = count($matches); // count all arrays
$order = 1; // define showorder used for options
for($i=0; $i<$colors; $i++){
echo $matches[$i][1];
// hand each seperate color, size, qty code
}
In this situation not all products have all sizes available for each color even though xcart wants us to specify every option anyways. So this is what I'm trying to do here. Then I think I have to run the script again or make another script that will rerun and check the variants against what product options are actually available and then insert into xcart_product_options_ex what to exclude the options that are not available. What do you think? Do I need to run this script twice or can we make some code to do this all at once? I REALLY APPRECIATE IT.
Attached is the xcart_product_options_ex table with Red - S being not a valid choice for this sample product.