If you’re noticing your magento site database has grown to become very large take a look at this article on magento database maintenance…
Archive for the ‘Web Development’ Category
Magento database maintenance - large db tables
Wednesday, October 19th, 2011Magento - Delete test orders
Friday, September 16th, 2011NOTE: the script contains a table name prefix ‘#_’ which must be either changed or removed.
Magento < 1.5 use:
http://www.eliasinteractive.com/blog/magento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos/
Magento >= 1.5 use:
http://www.myscienceisbetter.info/delete-test-orders-in-magento-1-5-x.html
Once you’ve deleted your test orders and publish your live website you might find you get the error PayPal gateway has rejected request. Payment has already been made for this InvoiceID (#10412: Duplicate invoice) when trying to checkout live orders with paypal. This is because your paypal account has already processed a test order with this order id once and will not accept a second order with the same order no.
Here you you have two options:
1) change the padding of invoice numbers so your new invoice numbers won’t conflict with the old deleted ones. You can do this by changing the setting in your database e.g.
update `eav_entity_type` set `increment_pad_length`=10 where `entity_type_code`=’order’;
2) you can change the starting invoice number to a number greater than the last test order number to avoid the conflict - see http://www.magentocommerce.com/boards/viewthread/10985/ for more information
Debuggin in cakephp - write to the debug log file
Saturday, August 27th, 2011See http://book.cakephp.org/view/1195/Writing-to-logs for syntax to write to the debug log file. You also have other debugging tools available, for a complete reference see http://book.cakephp.org/view/1191/Using-the-Debugger-Class.
Putty timeout with message ”Network error: Software caused connection abort”
Saturday, August 27th, 2011If your putty ssh connection is disconnecting after some time of inactivity you can change either settings within your client or ssh server to avoid this and keep the connection aliive. For more information see http://ocaoimh.ie/2008/12/10/how-to-fix-ssh-timeout-problems/.
Paypal sandbox returns Pending
Friday, August 26th, 2011http://www.cosmocentral.com/2009/07/payment_status-value-in-paypal-sandbox-always-pending/
Find broken links on website
Monday, August 8th, 2011Use Xenu’s link slueth to find broken links on your website.
Sending emails in ASP.NET using System.Net.Mail
Monday, August 8th, 2011Sending emails using System.Net.Mail, see http://weblogs.asp.net/scottgu/archive/2005/12/10/432854.aspx.
Includes information on configuration mail server in web.config.
Using SpecifiedPickupDirectory during web development
Monday, August 8th, 2011Using SpecifiedPickupDirectory is something I only recently discovered. It’s a really nice development aid and prevents emails being sent to contacts in the development database, which is particularly useful when working with a sample of live data and you risk accidently firing off a round of automated emails to live email accounts during development.
Basically emails are created and stored in a specified local director instead of being sent to any email server for delivery. This way you can test and view generated emails without any risk of them actually being sent.
For more information see http://www.singular.co.nz/blog/archive/2007/11/28/using-an-smtp-pickup-directory-delivery-method-for-asp-net-development.aspx
and
C# DateTime arithmetic
Monday, August 8th, 2011I will build up a list of useful datetime arithmetic operations .
- Get datetime as of midnight for any DateTime value - example:
DateTime.Now - DateTime.Now.TimeOfDay - Get a datetime object containing the first day of the current month - example:
DateTime firstDayOfTheMonth = DateTime.Now.AddDays(-(DateTime.Now.Day-1)).Subtract(DateTime.Now.TimeOfDay) - Get a datetime object containing the last day of the current month - example:
firstDayOfThisMonth.AddMonths(1).AddDays(-1)
Sage website customers
Thursday, August 4th, 2011We have just completed a project with a client to automate the entering of website customers into Sage 50. This has greatly reduced the time and effort required to keep an up-to-date set of accounts.
The solution is fully automated and runs in the background without interfering in the website’s processing.