t
This commit is contained in:
@@ -6100,29 +6100,12 @@ Route::get('/aggiornapreorder/{idarticolo}/{postid}', function ($idarticolo, $po
|
|||||||
if ($product) {
|
if ($product) {
|
||||||
$titolo = $product['name'];
|
$titolo = $product['name'];
|
||||||
|
|
||||||
echo "Prodotto trovato: " . $product['name'] . "StockQty = " . $product['stock_quantity'] . "<br>";
|
echo "Prodotto trovato: " . $product['name'] . "StockQty = " . $product['stock_quantity'];
|
||||||
|
|
||||||
$variations = Variation::all($product_id);
|
if ($product['_is_pre_order'] == 'true') {
|
||||||
|
echo "<span class='badge badge-success'>PREORDER</span>: " . $product['_is_pre_order'] . "<br>";
|
||||||
if ($variations->count() > 0) {
|
|
||||||
echo "Variazioni: " . $variations->count() . "<br>";
|
|
||||||
|
|
||||||
foreach ($variations as $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>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
echo "<br>";
|
||||||
|
|
||||||
/*foreach ($variations as $variation) {
|
/*foreach ($variations as $variation) {
|
||||||
$found_key_version = array_search('Versione', array_column($variation->attributes, 'name'));
|
$found_key_version = array_search('Versione', array_column($variation->attributes, 'name'));
|
||||||
|
|||||||
Reference in New Issue
Block a user