t
This commit is contained in:
@@ -6102,35 +6102,24 @@ Route::get('/aggiornapreorder/{idarticolo}/{postid}', function ($idarticolo, $po
|
|||||||
|
|
||||||
echo "Prodotto trovato: " . $product['name'] . "StockQty = " . $product['stock_quantity'] . "<br>";
|
echo "Prodotto trovato: " . $product['name'] . "StockQty = " . $product['stock_quantity'] . "<br>";
|
||||||
|
|
||||||
$prodotti = null;
|
$variations = Variation::all($product_id);
|
||||||
$prodotti = new ModelsProduct();
|
|
||||||
|
|
||||||
$prodotti = $prodotti->where('sku', $sku)->get();
|
if ($variations->count() > 0) {
|
||||||
$id = 0;
|
|
||||||
|
|
||||||
if (!is_null($prodotti) && $prodotti->count() > 0) {
|
foreach ($variations as $variation) {
|
||||||
foreach ($prodotti as $prodotto) {
|
|
||||||
$variations = Variation::all($prodotto->id);
|
|
||||||
|
|
||||||
if ($variations->count() > 0) {
|
$found_key_version = array_search('Versione', array_column($variation->attributes, 'name'));
|
||||||
|
if ($variation->attributes[$found_key_version]->option == 'Nuovo') {
|
||||||
|
$arrmetadata = $variation->meta_data;
|
||||||
|
|
||||||
foreach ($variations as $variation) {
|
echo 'VARIAZIONE=' . json_encode($variation);
|
||||||
|
|
||||||
$found_key_version = array_search('Versione', array_column($variation->attributes, 'name'));
|
$found = isKeyPresent($arrmetadata, '_wpro_variable_is_preorder');
|
||||||
if ($variation->attributes[$found_key_version]->option == 'Nuovo') {
|
if ($found) {
|
||||||
$arrmetadata = $variation->meta_data;
|
$ispreorder = getValueByKey($arrmetadata, '_wpro_variable_is_preorder');
|
||||||
|
echo "<span class='badge badge-success'>Preorder</span>" . $ispreorder . "<br>";
|
||||||
echo 'VARIAZIONE=' . json_encode($variation);
|
|
||||||
|
|
||||||
$found = isKeyPresent($arrmetadata, '_wpro_variable_is_preorder');
|
|
||||||
if ($found) {
|
|
||||||
$ispreorder = getValueByKey($arrmetadata, '_wpro_variable_is_preorder');
|
|
||||||
echo "<span class='badge badge-success'>Preorder</span>" . $ispreorder . "<br>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// showarray($variations);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user