The checkout issue of not being able to proceed past entering the initial address is a real sod to sort out. There seems to be a variety of possible causes almost all of which leave no easy trail of errors or, in some cases, no errors at all. I am posting my latest discovery here after migrating a site a new server to find that I was unable to progress past stage 2 of the one-page-checkout process. Spoiler alert: it was the CSP!
So, one day, I noticed one of my servers was sending a ton of emails out to dodgy looking ….@mail.ru or ….@list.ru addresses. UH OH!
At first I thought the mail server on my webserver had been compromised. On further investigation I managed to see to that the contents of these mails were account registration validation emails. Looking in the Magento admin (Customers>Manage Customers) I saw them…thousands of new customer registrations – with Russian copy in the name fields and, on the whole [something]@mail.ru or [something]@list.ru addresses but also some with [something]@gmail.com.
To write information to your own custom log file, say to trace errors in a custom module, track odd behaviour or record that a certain event has happened, you use Mage::log()
Mage::log(‘<WHAT TO WRITE IN THE LOG>’, null, ‘FILENAME.log’, true);
If you want to log the output of an array, use print_r but with the second parameter set to true – this converts the output to a string.
e.g. Mage::log(print_r($myArray,true), null, ‘FILENAME.log’, true);
I hope this is helpful. If it has and has saved you some time, feel free to buy me a beer.
OK, so as lovely having ones browser update automatically to the latest version (see that IE you annoying thing) the recent Chrome update (currently at 69.0.3497.81 – fine incrementing there lads) did something rather strange. Aside from the oddly curvy address bar and tabs (hey this ain’t no MAC) the peeps at Google have decided to remove/hide the www. part of URLs in the address bar.
So www.thelazywebdev.co.uk will be displayed in the Chrome address bar as
Apparently this is the same for m. subdomains but I don’t have of those to test.
Anyway…for me this is REALLY ANNOYING as I have local development copies of sites without www. but that look similar to their live counterparts. Besides, in many situations the sub domain IS important.
Fortunately this odd functionality can be reset back to normal using one of the chrome settings flags. Enter this as your URL in chrome:
and you can change it. Yes! Grumble over. I wonder how many updates away we are from this being reset.
I think custom variables were originally designed to be used in emails but I use them within the main site for little bits of information whose value needs to change on a per store/language basis.
This is how you get a custom variable inside a phtml file:
You may well have certain pages that you do not want Google, et al, to index in the SERPS. Examples include log in pages, thank you pages, and perhaps content of little search value such as legal blurb. This can let you control a little more, albeit very slightly, the pages you want Google to show and those that you don’t.
You can use the Custom Layout Update control (in the Custom Design tab) to set the robots control on a per-page basis. Simply add the following code into the Custom Layout Update textarea in the Magento admin:
Some useful bits and bobs to do with ordering, size-limiting and getting data out of collections that I tend to often need to look up.
Limiting the Size of a Collection
Loading Friendly URLs/Rewrites
Filter Collection by Attribute and Conditionals List
Get First Item From Collection
As of today (1st November 2017) we noticed a change in how Google is producing searching results. We knew that this change would be affecting mobile search results (mobile first index) but today we have seen it happen on desktop. This Google algorithm change might rock the SEO world…[update:….but hasn’t]
Sometimes, when editing a page you need to know what the full module_controller_action route is so you can modify the correct blocks in the layout files. Here is a simple bit of code to display the full action name in the form of module_controller_action.
Another quick post. This has often driven me crazy so I was glad to have found a solution.
The problem: you are clicking away, adding a whole load of cursors to edit multiple sections of code at once (awesome!) but then you accidentally click in the wrong place…argh.
Without knowing how to deselect or remove a multi cursor you have to start all over again, this time being very slow and precise in case you do it again.
The solution: By using alt+ middle mouse button on the offending cursor you can remove it from the “selection” – doesn’t even have to be the last one! Nice.
I have seen elsewhere that a regular alt-click or ctrl-u )soft undo) will do it but they did now work for me.
Note: the usual approach is that ctrl-something will perform an add action and alt-something will perform a remove action.