-
Notifications
You must be signed in to change notification settings - Fork 119
feat: add carrier name under each product on order history page #804
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
Merged
tblivet
merged 14 commits into
PrestaShop:develop
from
Nakahiru:feature/order-history-multi-shipment
Dec 5, 2025
Merged
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
87be8ac
feat: add carrier name under each product on order history page
Nakahiru 8ab753e
fix: revert changes to default templates
Nakahiru 043e338
fix: add missing for loop on products
Nakahiru 7fb6980
fix: add missing carrier name
Nakahiru 458c0ff
chore: review fixes
tblivet 326db67
chore: review fixes
tblivet 1ea0184
fix: handle also the shipment table on order history page
Nakahiru 1634baa
chore: add missing copyright
Nakahiru 16cda77
feat: add wording to add some context
Nakahiru 4be947a
fix(smarty): add missing default value
Nakahiru 8e2b62b
fix: use sprintf to better handle some wording
Nakahiru 9869848
fix: use sprintf for some wording
Nakahiru 233c73c
fix: use only one translation instead of two
Nakahiru e48dcca
fix: use only one translation
Nakahiru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| {** | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| *} | ||
| <section class="order-carriers"> | ||
| <h3 class="h3" id="order_carriers_heading">{l s='Shipment tracking details' d='Shop.Theme.Customeraccount'}</h3> | ||
|
|
||
| <div class="grid-table" role="table" aria-label="{l s='Order tracking' d='Shop.Theme.Customeraccount'}" aria-describedby="order_carriers_heading"> | ||
| <div class="grid-table__inner grid-table__inner--5" role="rowgroup"> | ||
| <div class="grid-table__header" role="row"> | ||
| <span class="grid-table__cell" role="columnheader">{l s='Date' d='Shop.Theme.Global'}</span> | ||
| <span class="grid-table__cell" role="columnheader">{l s='Carrier' d='Shop.Theme.Checkout'}</span> | ||
| <span class="grid-table__cell" role="columnheader">{l s='Weight' d='Shop.Theme.Checkout'}</span> | ||
| <span class="grid-table__cell" role="columnheader">{l s='Shipping cost' d='Shop.Theme.Checkout'}</span> | ||
| <span class="grid-table__cell" role="columnheader">{l s='Tracking number' d='Shop.Theme.Checkout'}</span> | ||
| </div> | ||
|
|
||
| {foreach from=$order.shipping item=line} | ||
| <div class="grid-table__row" role="row"> | ||
| <span class="grid-table__cell" role="cell" data-ps-label="{l s='Date' d='Shop.Theme.Global'}"> | ||
| {$line.shipping_date} | ||
| </span> | ||
| <span class="grid-table__cell" role="cell" data-ps-label="{l s='Carrier' d='Shop.Theme.Checkout'}"> | ||
| {$line.carrier_name} | ||
| </span> | ||
| <span class="grid-table__cell" role="cell" data-ps-label="{l s='Weight' d='Shop.Theme.Checkout'}"> | ||
| {$line.shipping_weight} | ||
| </span> | ||
| <span class="grid-table__cell" role="cell" data-ps-label="{l s='Shipping cost' d='Shop.Theme.Checkout'}"> | ||
| {$line.shipping_cost} | ||
| </span> | ||
| <span class="grid-table__cell" role="cell" data-ps-label="{l s='Tracking number' d='Shop.Theme.Checkout'}"> | ||
| {$line.tracking nofilter} | ||
| </span> | ||
| </div> | ||
| {/foreach} | ||
| </div> | ||
| </div> | ||
| </section> | ||
55 changes: 55 additions & 0 deletions
55
templates/customer/_partials/order-detail-no-return-multishipment.tpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| {** | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| *} | ||
| {block name='order_products_table'} | ||
| <div class="grid-table grid-table--collapse mb-0" role="table" aria-label="{l s='Products details' d='Shop.Theme.Customeraccount'}" aria-describedby="order_products_heading"> | ||
| <div class="grid-table__inner grid-table__inner--4" role="rowgroup"> | ||
| <div class="grid-table__header" role="row"> | ||
| <span class="grid-table__cell" role="columnheader">{l s='Product' d='Shop.Theme.Catalog'}</span> | ||
| <span class="grid-table__cell grid-table__cell--center" role="columnheader">{l s='Quantity' d='Shop.Theme.Catalog'}</span> | ||
| <span class="grid-table__cell grid-table__cell--center" role="columnheader">{l s='Unit price' d='Shop.Theme.Catalog'}</span> | ||
| <span class="grid-table__cell grid-table__cell--right" role="columnheader">{l s='Total price' d='Shop.Theme.Catalog'}</span> | ||
| </div> | ||
|
|
||
| {foreach $order->order_shipments['physical_products'] item=shipment} | ||
| {foreach from=$shipment['products'] item=product} | ||
| {assign var="is_last_product" value=($product@last && empty($order->order_shipments['virtual_products']))} | ||
|
|
||
| {include | ||
| file='./order-detail-product-line-no-return.tpl' | ||
| product=$product | ||
| carrier_name=$shipment['carrier']['name'] | ||
| is_last_product=$is_last_product | ||
| } | ||
| {/foreach} | ||
| {/foreach} | ||
|
|
||
| {foreach $order->order_shipments['virtual_products'] item=product} | ||
| {include file='./order-detail-product-line-no-return.tpl' product=$product is_last_product=$product@last} | ||
| {/foreach} | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="grid-table grid-table--collapse" role="table" aria-label="{l s='Order totals' d='Shop.Theme.Customeraccount'}"> | ||
| <div class="grid-table__inner grid-table__inner--6" role="rowgroup"> | ||
| {foreach $order.subtotals as $line} | ||
| {if $line.value} | ||
| <div class="grid-table__row" role="row"> | ||
| <span class="grid-table__cell grid-table__cell--label-value" role="cell" data-ps-label="{$line.label}"> | ||
| <span class="visually-hidden">{l s='%label%' d='Shop.Theme.Catalog' sprintf=['%label%' => $line.label]}</span> | ||
| {$line.value} | ||
| </span> | ||
| </div> | ||
| {/if} | ||
| {/foreach} | ||
|
|
||
| <div class="grid-table__row" role="row"> | ||
| <span class="grid-table__cell grid-table__cell--label-value" role="cell" data-ps-label="{$order.totals.total.label}"> | ||
| <span class="visually-hidden">{l s='Total price' d='Shop.Theme.Catalog'}</span> | ||
| {$order.totals.total.value} | ||
| </span> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {/block} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
143 changes: 143 additions & 0 deletions
143
templates/customer/_partials/order-detail-product-line-no-return.tpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| {** | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| *} | ||
| {block name='order_products_table_line_no_return'} | ||
| <div class="grid-table__row {if isset($is_last_product) && $is_last_product}rounded-bottom-0{/if}" role="row"> | ||
| <span class="grid-table__cell order-product" role="cell" data-ps-label="{l s='Product' d='Shop.Theme.Catalog'}"> | ||
| <span class="order-product__infos"> | ||
| <span class="order-product__image"> | ||
| <a href="{$link->getProductLink($product.id_product)}"> | ||
| {if isset($product.cover) && $product.cover} | ||
| <picture> | ||
| {if isset($product.cover.bySize.default_xs.sources.avif)} | ||
| <source | ||
| srcset=" | ||
| {$product.cover.bySize.default_xs.sources.avif}, | ||
| {$product.cover.bySize.default_md.sources.avif} 2x", | ||
| type="image/avif" | ||
| > | ||
| {/if} | ||
|
|
||
| {if isset($product.cover.bySize.default_xs.sources.webp)} | ||
| <source | ||
| srcset=" | ||
| {$product.cover.bySize.default_xs.sources.webp}, | ||
| {$product.cover.bySize.default_md.sources.webp} 2x" | ||
| type="image/webp" | ||
| > | ||
| {/if} | ||
|
|
||
| <img | ||
| class="order-product__img img-fluid" | ||
| srcset=" | ||
| {$product.cover.bySize.default_xs.url}, | ||
| {$product.cover.bySize.default_md.url} 2x" | ||
| width="{$product.cover.bySize.default_xs.width}" | ||
| height="{$product.cover.bySize.default_xs.height}" | ||
| loading="lazy" | ||
| alt="{$product.cover.legend}" | ||
| title="{$product.cover.legend}" | ||
| > | ||
| </picture> | ||
| {else} | ||
| <picture> | ||
| {if isset($urls.no_picture_image.bySize.default_xs.sources.avif)} | ||
| <source | ||
| srcset=" | ||
| {$urls.no_picture_image.bySize.default_xs.sources.avif}, | ||
| {$urls.no_picture_image.bySize.default_md.sources.avif} 2x" | ||
| type="image/avif" | ||
| > | ||
| {/if} | ||
|
|
||
| {if isset($urls.no_picture_image.bySize.default_xs.sources.webp)} | ||
| <source | ||
| srcset=" | ||
| {$urls.no_picture_image.bySize.default_xs.sources.webp}, | ||
| {$urls.no_picture_image.bySize.default_md.sources.webp} 2x" | ||
| type="image/webp" | ||
| > | ||
| {/if} | ||
|
|
||
| <img | ||
| class="order-product__img img-fluid" | ||
| srcset=" | ||
| {$urls.no_picture_image.bySize.default_xs.url}, | ||
| {$urls.no_picture_image.bySize.default_md.url} 2x" | ||
| width="{$urls.no_picture_image.bySize.default_xs.width}" | ||
| height="{$urls.no_picture_image.bySize.default_xs.height}" | ||
| loading="lazy" | ||
| > | ||
| </picture> | ||
| {/if} | ||
| </a> | ||
| </span> | ||
|
|
||
| <span class="order-product__content"> | ||
| <a class="order-product__name" href="{$link->getProductLink($product.id_product)}"> | ||
| {$product.name} | ||
| </a> | ||
|
|
||
| {if $product.product_reference} | ||
| <small class="text-secondary"> | ||
| {l s='Reference: %reference%' sprintf=['%reference%' => $product.product_reference] d='Shop.Theme.Catalog'} | ||
| </small> | ||
| {/if} | ||
|
|
||
| {if $product.is_virtual} | ||
| <small class="text-secondary"> | ||
| {l s='Virtual product(s)' d='Shop.Theme.Global'}: {l s='No delivery service' d='Shop.Theme.Global'} | ||
Nakahiru marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </small> | ||
| {/if} | ||
|
|
||
| {if !$product.is_virtual && isset($carrier_name)} | ||
| <small class="text-secondary"> | ||
| {l s='Carrier' d='Shop.Theme.Catalog'}: {$carrier_name} | ||
Nakahiru marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </small> | ||
| {/if} | ||
|
|
||
| {if isset($product.download_link)} | ||
| <a href="{$product.download_link}"> | ||
| <i class="material-icons" aria-hidden="true"></i> {l s='Download' d='Shop.Theme.Actions'} | ||
| </a> | ||
| {/if} | ||
|
|
||
| {if $product.customizations} | ||
| {foreach from=$product.customizations item="customization"} | ||
| <span id="product_customization_modal_wrapper_{$customization.id_customization}"> | ||
| {include file='catalog/_partials/customization-modal.tpl' customization=$customization} | ||
| </span> | ||
|
|
||
| <span class="customization"> | ||
| <a class="btn btn-sm btn-link p-0" href="#" data-bs-toggle="modal" | ||
| data-bs-target="#product-customizations-modal-{$customization.id_customization}"> | ||
| <i class="material-icons"></i> | ||
| {l s='Product customization' d='Shop.Theme.Catalog'} | ||
| </a> | ||
| </span> | ||
| {/foreach} | ||
| {/if} | ||
| </span> | ||
| </span> | ||
| </span> | ||
|
|
||
| <span class="grid-table__cell grid-table__cell--center" role="cell" data-ps-label="{l s='Quantity' d='Shop.Theme.Catalog'}"> | ||
| {if $product.customizations} | ||
| {foreach $product.customizations as $customization} | ||
| {$customization.quantity} | ||
| {/foreach} | ||
| {else} | ||
| {$product.quantity} | ||
| {/if} | ||
| </span> | ||
|
|
||
| <span class="grid-table__cell grid-table__cell--center" role="cell" data-ps-label="{l s='Unit price' d='Shop.Theme.Catalog'}"> | ||
| {$product.price} | ||
| </span> | ||
|
|
||
| <span class="grid-table__cell grid-table__cell--right" role="cell" data-ps-label="{l s='Total price' d='Shop.Theme.Catalog'}"> | ||
| {$product.total} | ||
| </span> | ||
| </div> | ||
| {/block} | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.