Skip to content

Conversation

sumitwebkul
Copy link
Contributor

No description provided.

shreesh-webkul and others added 30 commits February 26, 2025 11:07
…he product selling preference is sell with hotels.
…aiting payment to Complete payment received if the product selling preference is sell with hotels
…tity allowed from checkout page in front office.
…oduct selling preference is Selling with hotels and room types.
@rohit053 rohit053 merged commit 5da60bb into Qloapps:develop May 22, 2025
@rohit053 rohit053 requested review from Copilot and removed request for Copilot May 22, 2025 14:20
Copy link
Contributor

@Copilot Copilot AI left a 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 to selling_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);
Copy link

Copilot AI May 22, 2025

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.

Suggested change
// $objAddress = new Address($idAddressDelivery);

Copilot uses AI. Check for mistakes.

Comment on lines +3155 to +3156
$serviceAddressPrefrenceType = Configuration::get('PS_STANDARD_PRODUCT_ORDER_ADDRESS_PREFRENCE');
if ($serviceAddressPrefrenceType == Product::STANDARD_PRODUCT_ADDRESS_PREFERENCE_CUSTOMER) {
Copy link

Copilot AI May 22, 2025

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.

Suggested change
$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'));
Copy link

Copilot AI May 22, 2025

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.

Comment on lines +27 to +28
use Twig\Node\Expression\Binary\AddBinary;

Copy link

Copilot AI May 22, 2025

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.

Suggested change
use Twig\Node\Expression\Binary\AddBinary;

Copilot uses AI. Check for mistakes.

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

Successfully merging this pull request may close these issues.

4 participants