feat(CHOD-11867): Add salla-cart-summary-card component with responsive#899
feat(CHOD-11867): Add salla-cart-summary-card component with responsive#899abdomursal wants to merge 1 commit intomasterfrom
Conversation
Up to standards ✅🟢 Issues
|
| <salla-cart-summary-card initial-cart="{{ { | ||
| count: cart.count, | ||
| total: cart.total, | ||
| sub_total: cart.sub_total, | ||
| total_discount: cart.total_discount, | ||
| tax_amount: cart.tax_amount, | ||
| options_total: cart.options_total, | ||
| real_shipping_cost: cart.real_shipping_cost, | ||
| has_shipping: cart.has_shipping | ||
| }|json_encode }}"></salla-cart-summary-card> |
There was a problem hiding this comment.
options_total passed without an options-presence signal
The old template conditionally rendered the options total row only when cart.options|length > 0. The new salla-cart-summary-card component receives options_total: cart.options_total but no count or existence flag. If the component decides visibility based solely on whether options_total is truthy/non-zero, carts where options exist but sum to zero cost may silently hide the row. Consider passing options_count: cart.options|length alongside options_total so the component can replicate the same conditional the old template used.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/views/pages/cart.twig
Line: 221-230
Comment:
**`options_total` passed without an options-presence signal**
The old template conditionally rendered the options total row only when `cart.options|length > 0`. The new `salla-cart-summary-card` component receives `options_total: cart.options_total` but no count or existence flag. If the component decides visibility based solely on whether `options_total` is truthy/non-zero, carts where options exist but sum to zero cost may silently hide the row. Consider passing `options_count: cart.options|length` alongside `options_total` so the component can replicate the same conditional the old template used.
How can I resolve this? If you propose a fix, please make it concise.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behaviour? (You can also link to an open issue here)
What is the new behaviour? (You can also link to the ticket here)
Does this PR introduce a breaking change?
Screenshots (If appropriate)
Greptile Summary
This PR refactors the cart page sidebar by replacing the hand-crafted summary HTML block with the new
<salla-cart-summary-card>web component and extractssalla-cart-couponsinto its own styled card above the free-shipping bar.Confidence Score: 4/5
Safe to merge with minor suggestions addressed.
Only P2 findings remain after dropping hook feedback; P2s alone yield a 4/5.
src/views/pages/cart.twig — verify options_total signalling and mobile padding intent.
Important Files Changed
salla-cart-summary-cardweb component and movessalla-cart-couponsto a standalone card; minor concerns around options_total signalling and mobile padding.salla-cart-summary-cardcomponent; expected build artifact.Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat(CHOD-11867): update cart summary ca..." | Re-trigger Greptile