Skip to content

Instantly share code, notes, and snippets.

@chartjes
Created February 23, 2012 21:10
Show Gist options
  • Save chartjes/1895072 to your computer and use it in GitHub Desktop.
Save chartjes/1895072 to your computer and use it in GitHub Desktop.
// Check to make sure that our valid fields are in there
$requiredFields = array(
'price',
'name',
'description',
'type',
'shippingCost',
'vendorSku'
);
$valid = true;
foreach ($storeData['products'] as $rawProduct) {
$fields = array_keys($rawProduct);
foreach ($requiredFields as $requiredField) {
if (!in_array($requiredField, $fields)) {
$valid = false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment