Jump to content
chahidkhan

Editing order history page !

Recommended Posts

Hello

I need some modifications in order history page , i want to show product names in order reference place , and i want to change color of status text , sp please can you help me ??

 

 

Thanks a lot prestashop team :)

Share this post


Link to post
Share on other sites

you're talking about "order history" in front office?

Or maybe about orders list in the back office?

 

additional questions:

  1. what ps version you use?
  2. it's a default theme?

Share this post


Link to post
Share on other sites

Order history in front office ( for customers )

I use Prestashop 1.5.4.0 with default theme ..

 

 

Thank you

Share this post


Link to post
Share on other sites

you have to edit themes/_YOUR_THEME_/history.tpl file + history controller: controllers/front/historycontroller.php

 

it's not as easy as it seems, because you have to run query for products, because by default list of products aren't included to the smarty. What does it mean? It mean that you have to edit controllers. There is no other way to achieve this.

Share this post


Link to post
Share on other sites

Okay Thanks no problem with this , i have another modification to do if you can help me , i want orders don't appear in one page in front , every page will appear 10 orders for example

Share this post


Link to post
Share on other sites

Hi Guys

seem to have a problem with my customer order history with overlapping address

Think I have narrowed it down to the Order template file

The address overlaps the products

 

not sure what I need to do to fix it

thanks

Mark

 

{if isset($followup)}
<p class="bold">{l s='Click the following link to track the delivery of your order'}</p>
<a href="{$followup|escape:'htmlall':'UTF-8'}">{$followup|escape:'htmlall':'UTF-8'}</a>
{/if}
 
<div class="adresses_bloc clearfix">
<br />
<ul class="address item {if $order->isVirtual()}full_width{/if}">
<li class="address_title">{l s='Billing'}</li>
{foreach from=$inv_adr_fields name=inv_loop item=field_item}
{if $field_item eq "company" && isset($address_invoice->company)}<li class="address_company">{$address_invoice->company|escape:'htmlall':'UTF-8'}</li>
{elseif $field_item eq "address2" && $address_invoice->address2}<li class="address_address2">{$address_invoice->address2|escape:'htmlall':'UTF-8'}</li>
{elseif $field_item eq "phone_mobile" && $address_invoice->phone_mobile}<li class="address_phone_mobile">{$address_invoice->phone_mobile|escape:'htmlall':'UTF-8'}</li>
{else}
{assign var=address_words value=" "|explode:$field_item}
<li>{foreach from=$address_words item=word_item name="word_loop"}{if !$smarty.foreach.word_loop.first} {/if}<span class="address_{$word_item|replace:',':''}">{$invoiceAddressFormatedValues[$word_item|replace:',':'']|escape:'htmlall':'UTF-8'}</span>{/foreach}</li>
{/if}
 
{/foreach}
</ul>
<ul class="address alternate_item" {if $order->isVirtual()}style="display:none;"{/if}>
<li class="address_title">{l s='Delivery'}</li>
{foreach from=$dlv_adr_fields name=dlv_loop item=field_item}
{if $field_item eq "company" && isset($address_delivery->company)}<li class="address_company">{$address_delivery->company|escape:'htmlall':'UTF-8'}</li>
{elseif $field_item eq "address2" && $address_delivery->address2}<li class="address_address2">{$address_delivery->address2|escape:'htmlall':'UTF-8'}</li>
{elseif $field_item eq "phone_mobile" && $address_delivery->phone_mobile}<li class="address_phone_mobile">{$address_delivery->phone_mobile|escape:'htmlall':'UTF-8'}</li>
{else}
{assign var=address_words value=" "|explode:$field_item} 
<li>{foreach from=$address_words item=word_item name="word_loop"}{if !$smarty.foreach.word_loop.first} {/if}<span class="address_{$word_item|replace:',':''}">{$deliveryAddressFormatedValues[$word_item|replace:',':'']|escape:'htmlall':'UTF-8'}</span>{/foreach}</li>
{/if}
{/foreach}
</ul>
</div>
{$HOOK_ORDERDETAILDISPLAYED}
{if !$is_guest}<form action="{$link->getPageLink('order-follow', true)}" method="post">{/if}
<div id="order-detail-content" class="table_block">
<table class="std">
<thead>
<tr>

post-558341-0-56348300-1385066093_thumb.jpg

Edited by vaperus (see edit history)

Share this post


Link to post
Share on other sites

it looks like modified theme, so it;'s hard to say what you have to do.

well, the problem is with css styles, not with .tpl files.

Share this post


Link to post
Share on other sites

you have to edit themes/_YOUR_THEME_/history.tpl file + history controller: controllers/front/historycontroller.php

 

it's not as easy as it seems, because you have to run query for products, because by default list of products aren't included to the smarty. What does it mean? It mean that you have to edit controllers. There is no other way to achieve this.

i want to edit the query where will i get the queries i have to edit. I want to add extra columns to the order history page

Share this post


Link to post
Share on other sites

Hi again !!

 

Can someone help me please to change order statuses colors in order history in front page ? for example Delivered with green and Rejected with Red ?? Im using PS 1.5.4.0

 

Thanks in advance

Share this post


Link to post
Share on other sites

Hello,

 

I want to display product_name in "history.tpl"  ( version:1.6.1)

 

I have put in:

 

HistoryController.php

 

$products = Db::getInstance()->executeS('

        SELECT product_name

        FROM '._DB_PREFIX_.'order_detail WHERE  `id_order`= ');

 

$this->context->smarty->assign(array('products' => $products));

 

history.tpl

 

{foreach from=$products item=product}

{$product.product_name}

 {/foreach}

 

What should I write after “ `id_order`=“ in order to display product_name?

 

Thank you

Edited by adau (see edit history)

Share this post


Link to post
Share on other sites

That's not the proper way I think. Modify getCustomerOrders instead, and get the product name there. You can just use STRING_CONCAT on the product_name field in the first query there

Edited by Nemo1 (see edit history)

Share this post


Link to post
Share on other sites

That's not the proper way I think. Modify getCustomerOrders instead, and get the product name there. You can just use STRING_CONCAT on the product_name field in the first query there

 Thank you for your reply. I will follow your suggestion.

Share this post


Link to post
Share on other sites

Hello,

 

How can I edit the order history page? I just want to change "Product" to say "Download Your Product" in the order details tab because I sell digital products.

 

Thanks In advance  :)

Share this post


Link to post
Share on other sites

You can dimply edit order-detail.tpl :) theme folder

Share this post


Link to post
Share on other sites

Thanks for your reply, I tried to edit the file but couldn't find "Product" in any line, which line should I edit to change the word?

 

Thank you so much for your help  :)

Share this post


Link to post
Share on other sites

Never Mind, got it!! Thank you so much for your help, this community is GREAT!

 

Best Regards

Zm

Share this post


Link to post
Share on other sites

Hello,

 

Can anyone please help me here?

 

How can I add re-order button to order detail page? I just want to allow a user to reorder individual product from placed order

 

I am using PS-1.6.1.6 with default theme, I don't want to change in core files (tpl or controller)

 

Thanks

Edited by murtaza-vhora (see edit history)

Share this post


Link to post
Share on other sites

it is not possible to reorder selected products only

you can reorder whole order at the moment.

 

all other things requries custom development.

Share this post


Link to post
Share on other sites
On 11/22/2013 at 4:36 PM, chahidkhan said:

Hi Guys !

 

Any help to make 10 orders in first page in order history ?

 

Thanks

hello, all.

did you had some sucess doing that? 

i have a problem with a costumer long history and i think it would help to limit the last 12 or so orders in history.tpl

 

any help is welcome, thanks in advance

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More