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>";
|
||||
|
||||
$prodotti = null;
|
||||
$prodotti = new ModelsProduct();
|
||||
$variations = Variation::all($product_id);
|
||||
|
||||
$prodotti = $prodotti->where('sku', $sku)->get();
|
||||
$id = 0;
|
||||
if ($variations->count() > 0) {
|
||||
|
||||
if (!is_null($prodotti) && $prodotti->count() > 0) {
|
||||
foreach ($prodotti as $prodotto) {
|
||||
$variations = Variation::all($prodotto->id);
|
||||
foreach ($variations as $variation) {
|
||||
|
||||
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'));
|
||||
if ($variation->attributes[$found_key_version]->option == 'Nuovo') {
|
||||
$arrmetadata = $variation->meta_data;
|
||||
|
||||
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>";
|
||||
}
|
||||
}
|
||||
$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