-
Notifications
You must be signed in to change notification settings - Fork 631
Added: Standard product flow in QloApps #1399
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
Added: Standard product flow in QloApps #1399
Conversation
…ervice products page in back-office
…he product selling preference is sell with hotels.
…aiting payment to Complete payment received if the product selling preference is sell with hotels
…or more products to the cart
…or more products to the cart
…tity allowed from checkout page in front office.
… at front office is disabled
…n creating a product for Sell with hotels.
…ice products options in BackOffice.
…oduct selling preference is Selling with hotels and room types.
…product to an order from the order page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds the “standard product” flow by replacing the old service_product_type
field with a more flexible selling_preference_type
, updating price‐calculation logic for standalone products, and extending order/payment handling and admin UIs accordingly.
- Renamed
service_product_type
toselling_preference_type
and added new constants for product preferences. - Updated
getPriceStatic
/priceCalculation
to support standalone products and custom address preferences. - Modified payment and order‐validation logic to set tax addresses and include service products in confirmation emails.
- Refreshed numerous admin templates to handle the new preference types and editing of service/standalone products.
Reviewed Changes
Copilot reviewed 173 out of 173 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
classes/checkoutProcess/CheckoutCustomerDetailsStep.php | Commented-out unused Address instantiation |
classes/Product.php | Renamed property, added new constants & price logic for standards |
classes/PaymentModule.php | Updated tax-address assignment and service-product email handling |
admin/themes/default/template/controllers/orders/... (multiple files) | Updated admin UIs for service/standalone products and modals |
Comments suppressed due to low confidence (1)
classes/Product.php:187
- This comment no longer matches the renamed
selling_preference_type
property; update it to describe the new field’s purpose or remove it.
// Room type required to buy
{ | ||
$idAddressDelivery = $this->context->cart->id_address_delivery; | ||
$objAddress = new Address($idAddressDelivery); | ||
// $objAddress = new Address($idAddressDelivery); |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Remove or restore this commented Address instantiation—dead code can be confusing and should be cleaned up or documented if it's intended for future use.
// $objAddress = new Address($idAddressDelivery); |
Copilot uses AI. Check for mistakes.
$serviceAddressPrefrenceType = Configuration::get('PS_STANDARD_PRODUCT_ORDER_ADDRESS_PREFRENCE'); | ||
if ($serviceAddressPrefrenceType == Product::STANDARD_PRODUCT_ADDRESS_PREFERENCE_CUSTOMER) { |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in variable name and configuration key: use Preference
instead of Prefrence
for clarity and consistency.
$serviceAddressPrefrenceType = Configuration::get('PS_STANDARD_PRODUCT_ORDER_ADDRESS_PREFRENCE'); | |
if ($serviceAddressPrefrenceType == Product::STANDARD_PRODUCT_ADDRESS_PREFERENCE_CUSTOMER) { | |
$serviceAddressPreferenceType = Configuration::get('PS_STANDARD_PRODUCT_ORDER_ADDRESS_PREFERENCE'); | |
if ($serviceAddressPreferenceType == Product::STANDARD_PRODUCT_ADDRESS_PREFERENCE_CUSTOMER) { |
Copilot uses AI. Check for mistakes.
'-'.(int)$quantity.'-'.(int)$id_product_attribute. | ||
'-'.(int)$with_ecotax.'-'.(int)$id_customer.'-'.(int)$use_group_reduction.'-'.(int)$id_cart.'-'.(int)$real_quantity. | ||
'-'.($only_reduc?'1':'0').'-'.($use_reduc?'1':'0').'-'.($use_tax?'1':'0').'-'.(int)$decimals.'-'.($id_product_roomtype?(int)$id_product_roomtype:'0'); | ||
'-'.($only_reduc?'1':'0').'-'.($use_reduc?'1':'0').'-'.($use_tax?'1':'0').'-'.(int)$decimals.'-'.($id_hotel?(int)$id_hotel:'0').'-'.($id_product_option?(int)$id_product_option:'0'.'-'.($id_product_room_type?(int)$id_product_room_type:'0')); |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misplaced parentheses in the ternary expression will append -…
into the false branch string; split the room-type append outside the id_product_option
ternary to generate a correct cache key.
Copilot uses AI. Check for mistakes.
use Twig\Node\Expression\Binary\AddBinary; | ||
|
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This Twig import isn’t used anywhere in the file; remove it to avoid clutter and potential confusion.
use Twig\Node\Expression\Binary\AddBinary; |
Copilot uses AI. Check for mistakes.
No description provided.