ripristinaord
This commit is contained in:
105
routes/web.php
105
routes/web.php
@@ -2454,6 +2454,111 @@ Route::post('/updatecreate', function (Request $request) {
|
||||
});
|
||||
|
||||
|
||||
Route::get('/riprendiordine', function () {
|
||||
|
||||
$myidInternet = 69082;
|
||||
$date_created = "2024-08-12T07:48:00";
|
||||
$line_items = [
|
||||
[
|
||||
"id" => 259,
|
||||
"name" => "L'Altra Storia d'Italia - 1802-1947 - Nuovo",
|
||||
"product_id" => 55120,
|
||||
"variation_id" => 55121,
|
||||
"quantity" => 1,
|
||||
"tax_class" => null,
|
||||
"subtotal" => "19.95",
|
||||
"subtotal_tax" => "0.00",
|
||||
"total" => "19.95",
|
||||
"total_tax" => "0.00",
|
||||
"taxes" => [],
|
||||
"meta_data" => [
|
||||
[
|
||||
"id" => 2224,
|
||||
"key" => "pa_versione",
|
||||
"value" => "nuovo",
|
||||
"display_key" => "Versione",
|
||||
"display_value" => "Nuovo"
|
||||
],
|
||||
[
|
||||
"id" => 2241,
|
||||
"key" => "_reduced_stock",
|
||||
"value" => "1",
|
||||
"display_key" => "_reduced_stock",
|
||||
"display_value" => "1"
|
||||
]
|
||||
],
|
||||
"sku" => "19712",
|
||||
"price" => 19.95,
|
||||
"image" => [
|
||||
"id" => 64211,
|
||||
"src" => "https://i0.wp.com/www.fioredellavita.it/wp-content/uploads/2023/09/Copertina-altra-storia-d-italia-1802-1947-scaled.jpg?fit=1829%2C2560&ssl=1"
|
||||
],
|
||||
"parent_name" => "L'Altra Storia d'Italia - 1802-1947"
|
||||
],
|
||||
[
|
||||
"id" => 260,
|
||||
"name" => "L'Altra Storia d'Italia - 1948-2022 - Nuovo",
|
||||
"product_id" => 43241,
|
||||
"variation_id" => 57011,
|
||||
"quantity" => 1,
|
||||
"tax_class" => null,
|
||||
"subtotal" => "19.00",
|
||||
"subtotal_tax" => "0.00",
|
||||
"total" => "19.00",
|
||||
"total_tax" => "0.00",
|
||||
"taxes" => [],
|
||||
"meta_data" => [
|
||||
[
|
||||
"id" => 2234,
|
||||
"key" => "pa_versione",
|
||||
"value" => "nuovo",
|
||||
"display_key" => "Versione",
|
||||
"display_value" => "Nuovo"
|
||||
],
|
||||
[
|
||||
"id" => 2242,
|
||||
"key" => "_reduced_stock",
|
||||
"value" => "1",
|
||||
"display_key" => "_reduced_stock",
|
||||
"display_value" => "1"
|
||||
]
|
||||
],
|
||||
"sku" => "16108",
|
||||
"price" => 19,
|
||||
"image" => [
|
||||
"id" => 48250,
|
||||
"src" => "https://i0.wp.com/www.fioredellavita.it/wp-content/uploads/2022/11/altra-storia-d-italia-1948-2022-scaled.jpg?fit=1829%2C2560&ssl=1"
|
||||
],
|
||||
"parent_name" => "L'Altra Storia d'Italia - 1948-2022"
|
||||
]
|
||||
];
|
||||
|
||||
$prodotti = $line_items;
|
||||
foreach ($prodotti as $prodotto) {
|
||||
$myexistorder = getOrderByIdInternet($myidInternet);
|
||||
if (!$myexistorder) {
|
||||
|
||||
$orderdetail = new Orderdetail();
|
||||
$orderdetail->IdInternet = $myidInternet;
|
||||
$sku = $prodotto['sku'];
|
||||
$codifica = false;
|
||||
if (strlen($sku) > 7 || strpos($sku, 'USATO') === 0) {
|
||||
$codifica = true;
|
||||
}
|
||||
if ($codifica) {
|
||||
} else {
|
||||
$orderdetail->CodArticoloGM = intval($prodotto['sku']);
|
||||
}
|
||||
|
||||
$orderdetail->Qta = $prodotto['quantity'];
|
||||
$orderdetail->PrezzoLordo = $prodotto['total'];
|
||||
$orderdetail->Enabled = 1;
|
||||
$orderdetail->DataOra = $date_created;
|
||||
$orderdetail->save();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Route::get('/artlibroondemand', function () {
|
||||
set_time_limit(0);
|
||||
ob_implicit_flush(true);
|
||||
|
||||
Reference in New Issue
Block a user