mg3ddesign Posted June 29, 2012 Share Posted June 29, 2012 Hi all Does anyone know what to change on the order.print.php in admin in order that if there is more than one option, they are on different lines, rather than all being on one line. Shown on the attached is everything on one line. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 29, 2012 Share Posted June 29, 2012 Find this part at around line 43: {foreach from=$item.options item=option}» {$option}{/foreach} and change to: <br />{foreach from=$item.options item=option}» {$option}<br />{/foreach} Quote Link to comment Share on other sites More sharing options...
mg3ddesign Posted June 30, 2012 Author Share Posted June 30, 2012 Thats great, thanks for the quick reply. I'm now trying to do it Admin - orders.index.php and User- content.checkout.php but the code is different and the <br /> doesn't seem to be working... Any help is very much appreciated. Quote Link to comment Share on other sites More sharing options...
mg3ddesign Posted June 30, 2012 Author Share Posted June 30, 2012 Managed to do content.checkout.php as I needed to slightly change the CSS so just need a bit of help on orders.index.php. Many thanks Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 30, 2012 Share Posted June 30, 2012 Please share your change to content.checkout.php in case this would be useful to someone else. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 30, 2012 Share Posted June 30, 2012 The edit has no choice but to work. The break tag is in the HTML and the browser will honor it. One thing that was introduced in CC4 and greatly expanded upon in CC5 is the creation of a cached version of a previously rendered skin page. In the admin screen, under maintenance (I think), is a function to clear the skin cache. Do that and see if the edits to orders.index.php finally appear. Quote Link to comment Share on other sites More sharing options...
mg3ddesign Posted June 30, 2012 Author Share Posted June 30, 2012 HI bsmither I'm trying now, Im sure it will work, I'm just having difficulty on where to put the edit. Do you know which part of orders.index.php I should be editing? Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 30, 2012 Share Posted June 30, 2012 Allow me suggest Notepad++, a free programmer's editor, to do your file editing. As I suggested above, about line 43 is where you need to look for the art of the statement I suggest you change. Correct me if I am wrong, but since you are expressing some difficulty in finding where this edit should take place, I'm thinking you are using an editor that does not show line numbers. Quote Link to comment Share on other sites More sharing options...
mg3ddesign Posted June 30, 2012 Author Share Posted June 30, 2012 Im using dreamweaver CS5. The code in orders.index.php is as follows which is different to what you suggested and around line 140. I have tried different variants but nothing seems to work. Help in what to change in this file would be very much appreciated. {foreach from=$PRODUCTS item=product} <div id="item"> {$product.quantity} x {$product.name} - {$product.product_code} ({$product.line_formatted}) {if $product.digital}<a href="{$VAL_SELF}&reset_id={$product.id}" />[{$LANG.orders.reset_download_link}]</a>{/if}<span>{$product.price_total_formatted}</span> {if $product.options} <br />{$product.options} {/if} </div> {/foreach} Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 30, 2012 Share Posted June 30, 2012 Maybe this is the section that needs the break: {if isset($ORDER_LIST)} <tfoot> <tr> <td><img src="{$SKIN_VARS.admin_folder}/skins/{$SKIN_VARS.skin_folder}/images/select_all.gif" alt="" /></td> <td><a href="#" class="check-all" rel="all-orders">{$LANG.form.check_uncheck}</a></td> <td colspan="6"> {$LANG.orders.with_selected}: <select name="multi-status" class="textbox"> <option value="">{$LANG.orders.option_status_no_change}</option> <optgroup label="{$LANG.orders.change_order_status}"> {foreach from=$LIST_ORDER_STATUS item=status}<option value="{$status.id}"{$status.selected}>{$status.string}</option>{/foreach} </optgroup> </select> {$LANG.common.then} <select name="multi-action" class="textbox"> <option value="">{$LANG.orders.option_nothing}</option> <option value="print">{$LANG.orders.option_print}</option> <option value="delete" style="color: red;">{$LANG.orders.option_delete}</option> </select> <input type="submit" value="{$LANG.common.go}" name="go"/> </td> </tr> </tfoot> {/if} Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 1, 2012 Share Posted July 1, 2012 Let's be clear about what file we are editing: For CC510, adminskinsdefaulttemplatesorders.print.php This is the file specifically mentioned in post #1 of this conversation and is directly relevant to the subject of this conversation. My copy of this file, being in the skin...templates folder, is a full HTML document and is what is used by CubeCart's administration side of the store to print a receipt (shipping label) of an order, and is usually a document the customer eventually receives. I see that later in this conversation, the file of interest has changed to orders.index.php which displays in a list some or all orders, and displays an overview/summary of any particular order for the admin's benefit. (I applaud you for using CS5, as CS4 was almost good enough, but CS3 and earlier was completely unsuitable for editing partial HTML documents with embedded templating code.) If you are wishing to split each selected option for the product ordered to a new line, then there needs to be a small edit in the controller file, as well as the view file - the HTML template file - in the model-view-controller (MVC) scheme, order.index.php. adminsourcesorders.index.inc.php, about line 236. Find this part: implode(' ', unserialize($product['product_options'])); We will leave it as an array: unserialize($product['product_options']); Then, in order.index.php, find near line 145: <br />{$product.options} We need to have the template to break apart this array: <br />{foreach from=$product.options item=option}{$option}<br />{/foreach} Clear the skin cache (just to make sure) and watch for the inevitable case where something else that relies on orders.index.inc.php to blow up spectacularly. Quote Link to comment Share on other sites More sharing options...
mg3ddesign Posted July 1, 2012 Author Share Posted July 1, 2012 Thanks, that all works now on all files. Sorry if I was not clear, maybe I should have changed the post title. When you have more than a few options I think it is important for both customers and admin to be able to read the order easily. I do think that this is something that should be done as standard on cube cart. I will pass it across to them Many thanks Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted July 1, 2012 Share Posted July 1, 2012 As Bsmither said - keep an eye out for unintended consequences on other pages. I'll mark this thread as resolved, but be sure to report if you find a problem theses changes caused anywhere else, even if you fix it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.