// условие: сумма от 1000 до 1499
if ($woocommerce->cart->total >= $cart_total
&& $woocommerce->cart->total <= 1499) {
if (sizeof($woocommerce->cart->get_cart()) > 0) {
foreach ($woocommerce->cart->get_cart() as $cart_item_key => $values) {
$_product = $values['data'];
if ($_product->get_id() == $product_id)
$found = true;
}
if (!$found)
$woocommerce->cart->add_to_cart($product_id);
} else {
$woocommerce->cart->add_to_cart($product_id);
}
} elseif ($woocommerce->cart->total >= 1500) { // условие: сумма от 1500
/* ... */
}
Route::get('storage/{filename}', function ($filename)
{
$path = storage_path('app\public\\' . $filename);
if (!File::exists($path)) {
abort(404);
}
$file = File::get($path);
$type = File::mimeType($path);
$response = Response::make($file, 200);
$response->header("Content-Type", $type);
return $response;
});