1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00

(feat) show product sku in cart and order detail

This commit is contained in:
Du Peng 2022-09-13 18:55:08 +02:00
parent 522b559ced
commit f130ba46c1
4 changed files with 4 additions and 2 deletions

View File

@ -142,7 +142,7 @@ const StoreCart: React.FC<StoreCartProps> = ({ onSuccess, onError, currentUser,
<img alt=''src={item.orderable_main_image_url || noImage} /> <img alt=''src={item.orderable_main_image_url || noImage} />
</div> </div>
<div className="ref"> <div className="ref">
<span>{t('app.public.store_cart.reference_short')} </span> <span>{t('app.public.store_cart.reference_short')} {item.orderable_ref || ''}</span>
<p>{item.orderable_name}</p> <p>{item.orderable_name}</p>
</div> </div>
<div className="actions"> <div className="actions">

View File

@ -173,7 +173,7 @@ export const ShowOrder: React.FC<ShowOrderProps> = ({ orderId, currentUser, onEr
<img alt=''src={item.orderable_main_image_url || noImage} /> <img alt=''src={item.orderable_main_image_url || noImage} />
</div> </div>
<div className="ref"> <div className="ref">
<span>{t('app.shared.store.show_order.reference_short')}</span> <span>{t('app.shared.store.show_order.reference_short')} {item.orderable_ref || ''}</span>
<p>{item.orderable_name}</p> <p>{item.orderable_name}</p>
</div> </div>
<div className="actions"> <div className="actions">

View File

@ -31,6 +31,7 @@ export interface Order {
orderable_type: string, orderable_type: string,
orderable_id: number, orderable_id: number,
orderable_name: string, orderable_name: string,
orderable_ref?: string,
orderable_main_image_url?: string, orderable_main_image_url?: string,
quantity: number, quantity: number,
quantity_min: number, quantity_min: number,

View File

@ -25,6 +25,7 @@ json.order_items_attributes order.order_items.order(created_at: :asc) do |item|
json.orderable_type item.orderable_type json.orderable_type item.orderable_type
json.orderable_id item.orderable_id json.orderable_id item.orderable_id
json.orderable_name item.orderable.name json.orderable_name item.orderable.name
json.orderable_ref item.orderable.sku
json.orderable_main_image_url item.orderable.main_image&.attachment_url json.orderable_main_image_url item.orderable.main_image&.attachment_url
json.quantity item.quantity json.quantity item.quantity
json.quantity_min item.orderable.quantity_min json.quantity_min item.orderable.quantity_min