noesac Posted July 6, 2010 Share Posted July 6, 2010 Hi all, I have benefited a lot from this community so I thought it would be a good chance for me to contribute back. I have made a lot of mods to my site (over 100 altogether!), but I would like to share a few Australian specific changes that I have made to my site for any other Aussies out there. Firstly it's important to remember: 1) Comment all changes clearly so you can find them. For example the convention I use is: ``````two lines of spacing```````````one line of spacing````````````code change or addition````````````two lines of spacing``````2) In general you should try to avoid superfluous changes if possible. When new Prestashop versions come out you will find upgrading very difficult. However i'm being very hypocritical here because I have made so many changes myself…sometimes UI tweaks, bug fixes, specific business rules / logic changes are impossible to avoid so I realise this is a very hard goal to stick to….More experienced / capable coders out there can probably just ignore this tip. Without further ado here I go (unfortunately I can't tell you specifically which line I made these changes on as commenting has thrown it all out of order, and also v1.3.1 changes have introduced new code everywhere...just search for the code): ----------------------------------------------Document: PDF.phpChange: changed "Invoice" to "Tax Invoice" Why: this is an Australian legal tax compliance requirement.From: $this->Cell(77, 10, self::l('INVOICE #').' '.Configuration::get('PS_INVOICE_PREFIX', intval($cookie->id_lang)).sprintf('d', self::$order->invoice_number), 0, 1, 'R'); To: $this->Cell(77, 10, self::l('TAX INVOICE #').' '.Configuration::get('PS_INVOICE_PREFIX', intval($cookie->id_lang)).sprintf('d', self::$order->invoice_number), 0, 1, 'R'); ----------------------------------------------Document: payment.tplChange: "Bank wire" to "Direct deposit"Why: because the term "bank wire" is American and makes no sense for locals!From: {l s='Pay by bank wire (order process will be longer)' mod='bankwire'} To: {l s='Pay by direct bank deposit (order process will be longer)' mod='bankwire'} Document: bankwire.htlAnd From: Please note that you have selected to pay by bank wire. Please send your payment to : To: Please note that you have selected to pay by direct bank deposit. Please send your payment to : Document: bankwire.txtAnd from: Please note that you have selected to pay by bank wire. Please send your payment to: To: Please note that you have selected to pay by direct bank deposit. Please send your payment to: ----------------------------------------------Document: authentication.tplChange: switched "city" and "postcode" fieldsWhy: it's more natural for Australians to enter their details in this format. During usability tests users found it very awkward to enter information in this order (for example) "123 James St Manly, Sydney" is much more natural than "123 James Street, Sydney Manly". When it comes to online shoppers, any bit of resistance can lose you a sale, so this is more important than it looks:)Switched: {l s='City'} <input type="text" class="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{/if}" /> * With: {l s='Postal code / Zip code'} <input type="text" class="text" name="postcode" id="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{/if}" /> * NOTE: I am using the "OnePageCheckout" so for regular users see this thread for more info (credits to Rocky): http://www.prestashop.com/forums/viewthread/61323/general_discussion/solved_how_to_move_the_postcode__zip_code_field_under_the_city_field----------------------------------------------FINALLY: I made a number of changes to remove Amex logos and text from around the site. Amex is not very popular in AU and a lot of payment gateway providers and banks charge a higher fee to support this. Obviously this is not applicable to everyone so I have not included this here. Happy for anyone to add continue building on this, as I'm sure there are a lot of Aussie Prestashop users out there. Cheers Link to comment Share on other sites More sharing options...
Wingz Posted July 6, 2010 Share Posted July 6, 2010 Thanks! I'd be keen to see more of these kinds of tips. Much appreciated. Link to comment Share on other sites More sharing options...
rocky Posted July 7, 2010 Share Posted July 7, 2010 Most of these changes can be made using the translation tool instead of modifying code. That will reduce the number of changes required to the code. You then only need to export your translations and re-import them when upgrading. Link to comment Share on other sites More sharing options...
rudd Posted January 14, 2011 Share Posted January 14, 2011 Hi Rocky,Where can find the translational tools you referring to?Thanks Link to comment Share on other sites More sharing options...
Wingz Posted January 14, 2011 Share Posted January 14, 2011 Rudd ...admin/tools/translations Link to comment Share on other sites More sharing options...
rudd Posted January 14, 2011 Share Posted January 14, 2011 Thanks Wingz Link to comment Share on other sites More sharing options...
ctc Posted March 4, 2011 Share Posted March 4, 2011 Thanks everyone, that translation tool is very useful! Can anyone clarify for me the best way to deal with address layout issues? In Australia, for example, addresses should be:1 Something StCity, State, 1234AustraliaAt the moment, my Prestashop installation formats addresses as follows:1 Something St1234 CityAustralia - StateObviously this is not correct! Any ideas on how to amend this (ideally without having to edit code) would be greatly appreciated.Christian Link to comment Share on other sites More sharing options...
ctc Posted March 11, 2011 Share Posted March 11, 2011 Hi everyone,I'm still having terrible trouble trying to customise the layout of addresses on my invoices. I have tried editing the PDF.php file, and have managed to get the shop address displaying correctly in the footer, but I cannot get customer addresses to work! If someone can please help it would be absolutely fantastic! This is the only thing that is keeping my shop closed at the moment... Link to comment Share on other sites More sharing options...
ctc Posted March 17, 2011 Share Posted March 17, 2011 Can someone please help with the address issue? I know that the suggestion above is to change fields around on the input pages, but the method seems rather clunky, and I am unsure how many template files I need to edit. Also, my problem is not only with the layout of fields on the input pages, but in the way the address is actually reproduced once it has been input, both on web pages in the site and on delivery dockets and invoices. I am sure that this problem affects other people - it would be fantastic if I could get this problem sorted out. Link to comment Share on other sites More sharing options...
Zenith Posted March 17, 2011 Share Posted March 17, 2011 Changing the address format cannot be done without editing the core files.....So here we go......first checkout process # #----------[ OPEN ]---------- # themes/prestashop/js/order-address.php # #----------[ FIND ]---------- # $('ul#address_' + addressType + ' li.address_city').html(addresses[idAddress][5] + ' ' + addresses[idAddress][6]); $('ul#address_' + addressType + ' li.address_country').html(addresses[idAddress][7] + (addresses[idAddress][8] != '' ? ' (' + addresses[idAddress][8] +')' : '')); # #----------[ REPLACE WITH ]---------- # $('ul#address_' + addressType + ' li.address_city').html(addresses[idAddress][6] + (addresses[idAddress][8] != '' ? ', ' + addresses[idAddress][8] + ' ' : ' ') + addresses[idAddress][5]); $('ul#address_' + addressType + ' li.address_postcode').html(addresses[idAddress][5]); $('ul#address_' + addressType + ' li.address_country').html(addresses[idAddress][7]); Next, pdf invoices # #----------[ OPEN ]---------- # classes/PDF.php # #----------[ FIND ]---------- # $pdf->Cell($width, 10, $delivery_address->postcode.' '.Tools::iconv('utf-8', self::encoding(), $delivery_address->city), 0, 'L'); $pdf->Cell($width, 10, $invoice_address->postcode.' '.Tools::iconv('utf-8', self::encoding(), $invoice_address->city), 0, 'L'); $pdf->Ln(5); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->country.($deliveryState ? ' - '.$deliveryState->name : '')), 0, 'L'); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->country.($invoiceState ? ' - '.$invoiceState->name : '')), 0, 'L'); # #----------[ REPLACE WITH ]---------- # $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->city).($deliveryState ? ', '.$deliveryState->name : '').' '.$delivery_address->postcode, 0, 'L'); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->city).($invoiceState ? ', '.$invoiceState->name : '').' '.$invoice_address->postcode, 0, 'L'); $pdf->Ln(5); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->country), 0, 'L'); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->country), 0, 'L'); I think that's all.....if there are any other spots just let me know and I'll post the code changes Link to comment Share on other sites More sharing options...
ctc Posted March 17, 2011 Share Posted March 17, 2011 Thanks Zenith,After a couple of weeks of trawling the forums I've finally found a few solutions. Most of them have been posted by johnstcks, and involve editing the files you've mentioned, as well as admin\tabs\AdminAddresses.php and AdminOrders.php, themes\Prestashop\address.tpl addresses.tpl authentication.tpl order-address.tpl order-detail.tpl and shopping-cart.tplWith your suggestions and the answers I've found from johnstcks, I should be able to figure it out. It's just such a pain editing the PHP code! All it takes is missing one character and the whole thing fails Link to comment Share on other sites More sharing options...
Recommended Posts