diff --git a/packages/Webkul/BookingProduct/src/Helpers/Booking.php b/packages/Webkul/BookingProduct/src/Helpers/Booking.php index 32df0c388..0deff259a 100644 --- a/packages/Webkul/BookingProduct/src/Helpers/Booking.php +++ b/packages/Webkul/BookingProduct/src/Helpers/Booking.php @@ -399,15 +399,15 @@ class Booking $data['attributes'] = [ [ - 'attribute_name' => 'Event Ticket', + 'attribute_name' => trans('bookingproduct::app.shop.cart.event-ticket'), 'option_id' => 0, 'option_label' => $ticket->name, ], [ - 'attribute_name' => 'Rent From', + 'attribute_name' => trans('bookingproduct::app.shop.cart.event-from'), 'option_id' => 0, 'option_label' => Carbon::createFromTimeString($bookingProduct->available_from)->format('d F, Y'), ], [ - 'attribute_name' => 'Rent Till', + 'attribute_name' => trans('bookingproduct::app.shop.cart.event-till'), 'option_id' => 0, 'option_label' => Carbon::createFromTimeString($bookingProduct->available_to)->format('d F, Y'), ] @@ -430,15 +430,15 @@ class Booking $data['attributes'] = [ [ - 'attribute_name' => 'Rent Type', + 'attribute_name' => trans('bookingproduct::app.shop.cart.rent-type'), 'option_id' => 0, 'option_label' => trans('bookingproduct::app.shop.cart.' . $rentingType), ], [ - 'attribute_name' => 'Rent From', + 'attribute_name' => trans('bookingproduct::app.shop.cart.rent-from'), 'option_id' => 0, 'option_label' => $from, ], [ - 'attribute_name' => 'Rent Till', + 'attribute_name' => trans('bookingproduct::app.shop.cart.rent-till'), 'option_id' => 0, 'option_label' => $to, ] @@ -446,16 +446,41 @@ class Booking break; + case 'table': + $timestamps = explode('-', $data['booking']['slot']); + + $data['attributes'] = [ + [ + 'attribute_name' => trans('bookingproduct::app.shop.cart.booking-from'), + 'option_id' => 0, + 'option_label' => Carbon::createFromTimestamp($timestamps[0])->format('d F, Y h:i A'), + ], [ + 'attribute_name' => trans('bookingproduct::app.shop.cart.booking-till'), + 'option_id' => 0, + 'option_label' => Carbon::createFromTimestamp($timestamps[1])->format('d F, Y h:i A'), + ] + ]; + + if ($data['booking']['note'] != '') { + $data['attributes'][2] = [ + 'attribute_name' => trans('bookingproduct::app.shop.cart.special-note'), + 'option_id' => 0, + 'option_label' => $data['booking']['note'], + ]; + } + + break; + default: $timestamps = explode('-', $data['booking']['slot']); $data['attributes'] = [ [ - 'attribute_name' => 'Booking From', + 'attribute_name' => trans('bookingproduct::app.shop.cart.booking-from'), 'option_id' => 0, 'option_label' => Carbon::createFromTimestamp($timestamps[0])->format('d F, Y h:i A'), ], [ - 'attribute_name' => 'Booking Till', + 'attribute_name' => trans('bookingproduct::app.shop.cart.booking-till'), 'option_id' => 0, 'option_label' => Carbon::createFromTimestamp($timestamps[1])->format('d F, Y h:i A'), ] diff --git a/packages/Webkul/BookingProduct/src/Resources/lang/en/app.php b/packages/Webkul/BookingProduct/src/Resources/lang/en/app.php index 390400383..aed75c8a6 100644 --- a/packages/Webkul/BookingProduct/src/Resources/lang/en/app.php +++ b/packages/Webkul/BookingProduct/src/Resources/lang/en/app.php @@ -110,6 +110,15 @@ return [ 'renting_type' => 'Rent Type', 'daily' => 'Daily', 'hourly' => 'Hourly', + 'event-ticket' => 'Event Ticket', + 'event-from' => 'Event From', + 'event-till' => 'Event Till', + 'rent-type' => 'Rent Type', + 'rent-from' => 'Rent From', + 'rent-till' => 'Rent Till', + 'booking-from' => 'Booking From', + 'booking-till' => 'Booking Till', + 'special-note' => 'Special Request/Notes', ] ] ]; \ No newline at end of file