Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating an order via API in QloApps: "Undefined index: avg_paid_unit_price_tax_excl" and "Undefined index: amount_tax_excl" #1313

Open
DiegoNMedina opened this issue Nov 15, 2024 · 1 comment

Comments

@DiegoNMedina
Copy link

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:

  1. Set up a cart with a room using the QloApps API.
  2. Attempt to convert the cart into an order via the API.
  3. 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:

  1. Update the hotel-booking-cart-data.tpl.php template to check if the indices exist before accessing them.
  2. Ensure that the price and tax-related data are properly loaded into the cart before converting it to an order.
  3. 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.

@aman-webkul
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants