I have this in my controller
$shipping = array(
'quantity' => 1,
'image' => '/img/noimage.png',
'description' => '',
'title' => 'FIX ME', // this should never occur,
'price' => 100000 // this should never occur
);
switch (Input::get('shipping_method')) {
case Settings::SETTINGS_SHIPPING_NORMAL:
$shipping['title'] = 'Normal Delivery';
$shipping['price'] = 0;
break;
case Settings::SETTINGS_SHIPPING_EXPRESS:
$shipping['title'] = sprintf('Express Delivery - $%.2f', Settings::getOption('express_shipping_cost'));
$shipping['price'] = doubleval(Settings::getOption('express_shipping_cost'));
break;
}
$cart['shipping'] = $shipping;
$order = new Order();
$order->data = json_encode($cart, true);
$order->address = Input::get('shipping_address');
$order->info = Input::get('additional_info');
$order->price = Input::get('price');
$order->save();
If user choose Normal Delivery
price is +0 and I save $order->price = Input::get('price');
this is only the product/s price.
How can I make here condition if user choose Express Delivery
addition amount to be added to product price here
$order->price = Input::get('price');
something like
if (Settings::SETTINGS_SHIPPING_EXPRES)
{ $order->price = Input::get('price') + shipping_express_price; }
else { $order->price = Input::get('price'); }