QloApps is a Free and Open-source hotel management and reservation system to take a hotel business online. QloApps offers a Property Management System (PMS), a Booking Engine, and an attractive Hotel Website. Elevate hotel operations with QloApps to streamline processes and provide an enhanced experience for both hoteliers and guests.
Undefined Index Error: avg_paid_unit_price_tax_excl and amount_tax_excl in hotel-booking-cart-data.tpl.php
Description
Problem description:
While attempting to create an order via the QloApps API using a pre-configured cart, I encountered an error related to undefined indices in the file hotel-booking-cart-data.tpl.php. The error message is as follows:
Undefined index: avg_paid_unit_price_tax_excl (/var/www/html/cache/smarty/compile/36/88/7d/36887d61046a4b417fe6341a95db65c2dc9dde90_0.file.hotel-booking-cart-data.tpl.php, line 106) Undefined index: amount_tax_excl (/var/www/html/cache/smarty/compile/36/88/7d/36887d61046a4b417fe6341a95db65c2dc9dde90_0.file.hotel-booking-cart-data.tpl.php, line 162)
Steps to reproduce the issue:
Set up a cart with a room using the QloApps API.
Attempt to convert the cart into an order via the API.
The system generates errors related to undefined indices (avg_paid_unit_price_tax_excl and amount_tax_excl).
Diagnosis:
The error occurs in the compiled Smarty file, which suggests that the template hotel-booking-cart-data.tpl.php is trying to access indices that are not present.
The table qlo_htl_cart_booking_data, used to store booking information, does not contain the fields avg_paid_unit_price_tax_excl and amount_tax_excl.
Upon reviewing the structure of the table qlo_htl_cart_booking_data, these indices do not exist, indicating that the system is either looking for data in the wrong place or missing a step to populate this data.
Possible Cause:
It appears that QloApps expects these indices to exist in the qlo_htl_cart_booking_data table or in another related structure before completing the cart-to-order conversion process.
Alternatively, it could be an issue in the template hotel-booking-cart-data.tpl.php, where it does not check if these indices exist before attempting to access them.
Proposed Solution:
Update the hotel-booking-cart-data.tpl.php template to check if the indices exist before accessing them.
Ensure that the price and tax-related data are properly loaded into the cart before converting it to an order.
Review if the information needs to be populated in a different table (like qlo_cart or qlo_order_detail) to avoid missing indices.
Relevant Logs:
Including the error logs for reference:
Undefined index: avg_paid_unit_price_tax_excl (/var/www/html/cache/smarty/compile/36/88/7d/36887d61046a4b417fe6341a95db65c2dc9dde90_0.file.hotel-booking-cart-data.tpl.php, line 106) Undefined index: amount_tax_excl (/var/www/html/cache/smarty/compile/36/88/7d/36887d61046a4b417fe6341a95db65c2dc9dde90_0.file.hotel-booking-cart-data.tpl.php, line 162)
Thank you for your attention, and I look forward to your assistance in resolving this issue.
We have reviewed the issue you raised but were unable to reproduce at our end. To assist you further with the debugging, could you please confirm which version of QloApps you are using?
Undefined Index Error:
avg_paid_unit_price_tax_excl
andamount_tax_excl
inhotel-booking-cart-data.tpl.php
Description
Problem description:
While attempting to create an order via the QloApps API using a pre-configured cart, I encountered an error related to undefined indices in the file
hotel-booking-cart-data.tpl.php
. The error message is as follows:Undefined index: avg_paid_unit_price_tax_excl (/var/www/html/cache/smarty/compile/36/88/7d/36887d61046a4b417fe6341a95db65c2dc9dde90_0.file.hotel-booking-cart-data.tpl.php, line 106) Undefined index: amount_tax_excl (/var/www/html/cache/smarty/compile/36/88/7d/36887d61046a4b417fe6341a95db65c2dc9dde90_0.file.hotel-booking-cart-data.tpl.php, line 162)
Steps to reproduce the issue:
avg_paid_unit_price_tax_excl
andamount_tax_excl
).Diagnosis:
hotel-booking-cart-data.tpl.php
is trying to access indices that are not present.qlo_htl_cart_booking_data
, used to store booking information, does not contain the fieldsavg_paid_unit_price_tax_excl
andamount_tax_excl
.qlo_htl_cart_booking_data
, these indices do not exist, indicating that the system is either looking for data in the wrong place or missing a step to populate this data.Possible Cause:
qlo_htl_cart_booking_data
table or in another related structure before completing the cart-to-order conversion process.hotel-booking-cart-data.tpl.php
, where it does not check if these indices exist before attempting to access them.Proposed Solution:
hotel-booking-cart-data.tpl.php
template to check if the indices exist before accessing them.qlo_cart
orqlo_order_detail
) to avoid missing indices.Relevant Logs:
Including the error logs for reference:
Undefined index: avg_paid_unit_price_tax_excl (/var/www/html/cache/smarty/compile/36/88/7d/36887d61046a4b417fe6341a95db65c2dc9dde90_0.file.hotel-booking-cart-data.tpl.php, line 106) Undefined index: amount_tax_excl (/var/www/html/cache/smarty/compile/36/88/7d/36887d61046a4b417fe6341a95db65c2dc9dde90_0.file.hotel-booking-cart-data.tpl.php, line 162)
Thank you for your attention, and I look forward to your assistance in resolving this issue.