Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The replacement of the code is necessary to address a layout issue in the table caused by incorrect column handling, which can affect the proper display of data.
Explanation of the Problem
In the original code:
The table displays the HT (pre-tax) value in one column, and if the MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES variable is enabled, an additional column is added for the TTC (tax-included) value.
This means that the number of columns in the table changes depending on the configuration: an extra column appears when MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES is active.
This variation in the number of columns can cause issues with the table layout, especially if other cells (like headers or summary rows) use a colspan attribute that does not match the total number of columns, resulting in misalignment.
Why Replace with the New Code?
The new code solves this issue by displaying both the HT and TTC values in the same column, separated by a visual divider, when MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES is enabled:
If MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES is enabled: The HT value is followed by the TTC value within the same cell, maintaining a consistent column count.
Otherwise: Only the HT value is displayed, still within a single cell.
Conclusion :
Consistent Column Count: The number of columns remains constant, regardless of the MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES setting. This ensures that the colspan attribute in other parts of the table remains accurate, preserving the layout.
The code modification ensures that the table layout is correct and that columns remain alwys properly aligned, preventing layout issues that could occur if the number of columns.