juanunlin Posted May 3, 2013 Share Posted May 3, 2013 hello I would like to know how to add a buttom to customers to create orders directly because I have many requests by phone and I see the notes before ordering. thanks Link to comment Share on other sites More sharing options...
PascalVG Posted May 4, 2013 Share Posted May 4, 2013 (edited) If I understand your question well, you want to be able to add a new order from the customers-detail page, right? Edit the file (NB strange path, in your own 'admin' folder) <your admin folder>/themes/default/template/controllers/customers/helpers/view/view.tpl copy the following code: {* New Order button. Add your own link to 'new order page' *} <div ID="customer_new_order_btn"> <FORM> <INPUT TYPE="button" value="New order" onClick="parent.location='http://www.yourdomain.com/<your admin folder>/index.php?controller=AdminOrders&addorder&token=<token from your site>'"> </FORM> </div> {* button will be added just below existing orders-list *} Then find in the file the following text: has not placed any orders yet add the copied code at exactly the place mentioned below, otherwise it moves to a strange place on the page: {l s='%1$s %2$s has not placed any orders yet' sprintf=[$customer->firstname, $customer->lastname]} {/if} {* New Order button. Add your own link to 'new order page' *} <div ID="customer_new_order_btn"> <FORM> <INPUT TYPE="button" value="New order" onClick="parent.location='http://www.yourdomain.com/<your admin folder>/index.php?controller=AdminOrders&addorder&token=<token from your site>'"> </FORM> </div> {* button will be added just below existing orders-list *} </div> <div style="float:left;width:50%"> Replace your own link to the 'new order' page. (You can copy this link from your orders page and then right click on the green 'new order' button in the top right of the screen) Hope this is what you wanted. If any questions, just ask pascal Edited May 4, 2013 by PascalVG Edited code a little (see edit history) Link to comment Share on other sites More sharing options...
juanunlin Posted May 5, 2013 Author Share Posted May 5, 2013 (edited) I did as you said and goes blank when I click on any customer, why everything is stuck on the same file it? thanks Edited May 5, 2013 by juanunlin (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted May 5, 2013 Share Posted May 5, 2013 Can you copy the code you added exactly (and a little code before and after)? Link to comment Share on other sites More sharing options...
juanunlin Posted May 5, 2013 Author Share Posted May 5, 2013 if thank you very much <div style="width:50%;float:left;"> <h2>{l s='Messages'} ({count($messages)})</h2> {if count($messages)} <table cellspacing="0" cellpadding="0" class="table" style="width:100%;"> <tr> <th class="left">{l s='Status'}</th> <th class="left">{l s='Message'}</th> <th class="left">{l s='Sent on'}</th> </tr> {foreach $messages AS $message} <tr> <td class="left">{$message['status']}</td> <td class="left"> <a href="index.php?tab=AdminCustomerThreads&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread&token={getAdminToken tab='AdminCustomerThreads'}"> {$message['message']}... </a> </td> <td class="left">{$message['date_add']}</td> </tr> {/foreach} </table> <div class="clear"> </div> {else} {l s='%1$s %2$s has never contacted you' sprintf=[$customer->firstname, $customer->lastname]} {/if} <div ID="customer_new_order_btn"> <FORM> <INPUT TYPE="button" value="New order" onClick="parent.location='http://localhost/nuevatienda/adminasd/index.php?controller=AdminOrders&addorder&token=<token from your site>'"> </FORM> </div> </div> <div style="float:left;width:50%"> </div> <div style="width:50%;float:left;"> <div style="margin-left:15px;" <h2>{l s='Vouchers'} ({count($discounts)})</h2> {if count($discounts)} <table cellspacing="0" cellpadding="0" class="table"> <tr> <th>{l s='ID'}</th> <th>{l s='Code'}</th> <th>{l s='Name'}</th> <th>{l s='Status'}</th> <th>{l s='Actions'}</th> </tr> {foreach $discounts AS $key => $discount} <tr {if $key %2}class="alt_row"{/if}> <td align="center">{$discount['id_cart_rule']}</td> <td>{$discount['code']}</td> <td>{$discount['name']}</td> <td align="center"><img src="../img/admin/{if $discount['active']}enabled.gif{else}disabled.gif{/if}" alt="{l s='Status'}" title="{l s='Status'}" /></td> <td align="center"> <a href="?tab=AdminCartRules&id_cart_rule={$discount['id_cart_rule']}&addcart_rule&token={getAdminToken tab='AdminCartRules'}"><img src="../img/admin/edit.gif" /></a> <a href="?tab=AdminCartRules&id_cart_rule={$discount['id_cart_rule']}&deletecart_rule&token={getAdminToken tab='AdminCartRules'}"><img src="../img/admin/delete.gif" /></a> </td> </tr> {/foreach} </table> {else} {l s='%1$s %2$s has no discount vouchers' sprintf=[$customer->firstname, $customer->lastname]}. {/if} </div> </div> {* display hook specified to this page : AdminCustomers *} <div>{hook h="displayAdminCustomers" id_customer=$customer->id}</div> <div class="clear"> </div> <div style="width:50%;float:left;"> <h2>{l s='Orders'} ({count($orders)})</h2> {if $orders AND count($orders)} {assign var=count_ok value=count($orders_ok)} {if $count_ok} <div> <h3 style="color:green;font-weight:700;clear:both;"> {l s='Valid orders:'} {$count_ok} {l s='for'} {$total_ok} </h3> <table cellspacing="0" cellpadding="0" class="table" style="width:100%; text-align:left;"> <colgroup> <col width="10px"> <col width="100px"> <col width="100px"> <col width=""> Link to comment Share on other sites More sharing options...
PascalVG Posted May 11, 2013 Share Posted May 11, 2013 Hi Juanunlin, Sorry for late reply, was traveling to Holland, took some time... The link is not fully correct. The token is not given correctly. As I wrote: Replace your own link to the 'new order' page. (copy this link: from your orders page and then right click on the green 'new order' button in the top right of the screen. (Then copy the link address and past here in the code, complete with token number) Hope this helps, pascal Link to comment Share on other sites More sharing options...
juanunlin Posted May 13, 2013 Author Share Posted May 13, 2013 pascal thanks I appreciate your attention, I will try and tell you Link to comment Share on other sites More sharing options...
juanunlin Posted May 15, 2013 Author Share Posted May 15, 2013 Pascal I would like to preserve the user to make the order and not have to look for it, you know how to do? 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