PS newbi Posted July 16, 2015 Share Posted July 16, 2015 Hello Can anyone help? I would like to show only the latest order details in my order history. Is that possible? And how do i do? I tried to delete all code in history.tpl and just include the order history in it, but i get a blank page. I am new to prestashop. I hope someone can help. Thanks Link to comment Share on other sites More sharing options...
vekia Posted July 16, 2015 Share Posted July 16, 2015 by order history you're reffering to FRONT OFFICE where customers see the list of orders, or to back office where you as a shop administrator see orders placed by customers ? Link to comment Share on other sites More sharing options...
PS newbi Posted July 16, 2015 Author Share Posted July 16, 2015 (edited) Hello Vekia. Thanks for your reply It is the front office. And i am using 1.6. My customers will only be able to purchase one item and only once. That's why i only want to show the order detail. There will never be more than one order. I want to make it one click shorter for my customers. No order list, only order detail. Edited July 16, 2015 by PS newbi (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 16, 2015 Share Posted July 16, 2015 history.tpl at the end of the foreach loop add {break} like i did below: {foreach from=$orders item=order name=myLoop} <tr class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if} {if $smarty.foreach.myLoop.index % 2}alternate_item{/if}"> <td class="history_link bold"> {if isset($order.invoice) && $order.invoice && isset($order.virtual) && $order.virtual} <img class="icon" src="{$img_dir}icon/download_product.gif" alt="{l s='Products to download'}" title="{l s='Products to download'}" /> {/if} <a class="color-myaccount" href="javascript:showOrder(1, {$order.id_order|intval}, '{$link->getPageLink('order-detail', true)|escape:'html':'UTF-8'}');"> {Order::getUniqReferenceOf($order.id_order)} </a> </td> <td data-value="{$order.date_add|regex_replace:"/[\-\:\ ]/":""}" class="history_date bold"> {dateFormat date=$order.date_add full=0} </td> <td class="history_price" data-value="{$order.total_paid}"> <span class="price"> {displayPrice price=$order.total_paid currency=$order.id_currency no_utf8=false convert=false} </span> </td> <td class="history_method">{$order.payment|escape:'html':'UTF-8'}</td> <td{if isset($order.order_state)} data-value="{$order.id_order_state}"{/if} class="history_state"> {if isset($order.order_state)} <span class="label{if isset($order.order_state_color) && Tools::getBrightness($order.order_state_color) > 128} dark{/if}"{if isset($order.order_state_color) && $order.order_state_color} style="background-color:{$order.order_state_color|escape:'html':'UTF-8'}; border-color:{$order.order_state_color|escape:'html':'UTF-8'};"{/if}> {$order.order_state|escape:'html':'UTF-8'} </span> {/if} </td> <td class="history_invoice"> {if (isset($order.invoice) && $order.invoice && isset($order.invoice_number) && $order.invoice_number) && isset($invoiceAllowed) && $invoiceAllowed == true} <a class="link-button" href="{$link->getPageLink('pdf-invoice', true, NULL, "id_order={$order.id_order}")|escape:'html':'UTF-8'}" title="{l s='Invoice'}" target="_blank"> <i class="icon-file-text large"></i>{l s='PDF'} </a> {else} - {/if} </td> <td class="history_detail"> <a class="btn btn-default button button-small" href="javascript:showOrder(1, {$order.id_order|intval}, '{$link->getPageLink('order-detail', true)|escape:'html':'UTF-8'}');"> <span> {l s='Details'}<i class="icon-chevron-right right"></i> </span> </a> {if isset($opc) && $opc} <a class="link-button" href="{$link->getPageLink('order-opc', true, NULL, "submitReorder&id_order={$order.id_order|intval}")|escape:'html':'UTF-8'}" title="{l s='Reorder'}"> {else} <a class="link-button" href="{$link->getPageLink('order', true, NULL, "submitReorder&id_order={$order.id_order|intval}")|escape:'html':'UTF-8'}" title="{l s='Reorder'}"> {/if} {if isset($reorderingAllowed) && $reorderingAllowed} <i class="icon-refresh"></i>{l s='Reorder'} {/if} </a> </td> </tr> {break} {/foreach} Link to comment Share on other sites More sharing options...
PS newbi Posted July 16, 2015 Author Share Posted July 16, 2015 thank you. I am going to try it now. Link to comment Share on other sites More sharing options...
PS newbi Posted July 16, 2015 Author Share Posted July 16, 2015 (edited) This works fine, i only have one order, but would like to jump the step in the picture (the picture is not mine. it's just to give an idea of what i do not want).. I want to show the order details at once. What i mean is that when i go to order history, i should get the order details of the latest order, and not the order list with the latest order. The order history page should show the latest order with all details (customer name, adress, reference, product, quantity...) as soon as i enter the page. Edited July 16, 2015 by PS newbi (see edit history) Link to comment Share on other sites More sharing options...
PS newbi Posted July 16, 2015 Author Share Posted July 16, 2015 something more like an order confirmation. Link to comment Share on other sites More sharing options...
PS newbi Posted July 17, 2015 Author Share Posted July 17, 2015 up Link to comment Share on other sites More sharing options...
PS newbi Posted July 18, 2015 Author Share Posted July 18, 2015 Anyone? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now