Read all about my university goings on, my thoughts about the web in general, development ideas & coding tips and even some general randomness! Nice!
So, in magento you may have something set up so that you display boxes which contain information about your categories. For example you may have a nice list of your categories, with an image a “from” price and the category name, or even taken from my last post you may have how many products are in that category…
However, if you have a lot of categories & sub categories across your site you’ll know the pain of having to find a nice image for each category upload it into the category thumbnail bit of the admin and proceed. But I’ve written a small piece of code which allows you to not have to bother with all of that and simply use an image from your products – after all, the product that’s in the category would be a good image to use… Right?
So here’s my guide :
Step 1. Make a filter
Assuming you’ve already coded your list of categories nicely and everything but images is done and dusted you’re first step is to create a filter. My filter looks like the following :
$catimgs = $_category->getProductCollection()
->addAttributeToSelect(‘image’, array(‘neq’ => ”))
->addAttributeToFilter(‘status’, 1)
->addAttributeToFilter(‘visibility’, array(2,4))
->setPageSize(1);
What the above does is simple : Finds the products in the category and filters out products with no image, products that are disabled, products that are set to nowhere in visibility and returns the first product only.
Step 2. Make a foreach and display
Now you’ve got your product and it’s image the second (and last may I add!) step is to display the image, for that you’ll need to do something similar to the following :
foreach( $catimgs as $catimg ) { echo $catimg->getImageUrl() ; }
What the above does is say for every product in the list (which is already set to only one product, but it’s filtered as an array so this is still needed) echo out the image URL. Put that in the <img src=”"> function and you should see a product image in your category image.
Pretty cool eh?
One thing I had considered doing for a client was to make it so that only categories which contain products would display. I have created the code for reference and thought someone might find it useful so I’ve posted it out below.
This is very complex code so if you don’t get it at first read it through a few times :
if($_category->getProductCount()){
// Enter Category display code here
}
Really difficult right?! Okay, so I MAY have exaggerated slightly… Well, A lot. When you’ve got your categories listed out (in this case I’ve used the term $_category but you can use whatever) all you need to do is get Product Count and that tells you how many products are associated with that category. If it’s more than 0 then it’ll display them, if not it won’t. Simple yet effective.
One request from my client was to shorten the URL’s to become more SEO friendly when it came to having sub-categories. For example if the main category was diecast cars and it had a sub category of ‘audi cars’ the URL would be diecastcars.com/diecast-cars/audi-cars. But this isn’t particularly SEO friendly as you’ll fair much better having diecastcars.com/audi-cars. So I set about and here’s how I solved the issue :
In app / core / Mage / catalog / Model / Url.php there is a section which says :
if (null === $parentPath) {
$parentPath = $this->getResource()->getCategoryParentPath($category);
}
elseif ($parentPath == ‘/’) {
$parentPath = ”;
}
Now, rather than editing a core file directly (which is bad) I’ll download the file, and put a copy of it in my directory so now in app / core / local / Mage / catalog / Model / Url.php I replace the above with :
// if (null === $parentPath) {
// $parentPath = $this->getResource()->getCategoryParentPath($category);
// }
// elseif ($parentPath == ‘/’) {
$parentPath = ”;
// }
Give it a quick reindex to flush all of the stored URL’s and hey presto single layer category URL’s.
Had a meeting with my client today to discuss setting up a contract for further development on the site. We have agreed to a set amount of hours per month in which I will be available for any updates, bug fixes, new modules etc required.
This was agreed upon due to my client being unable to produce relevant information regarding pages, shipping, and extra payment options as this is a new set up company being part of several other companies. I will also be working on other companies my client owns.
The contract is set so that the site has been signed off as complete pending browser testing in IE and after a grace period of 6 weeks so that my client can obtain relevant information I will continue updates including :
Amongst other points.
If you have SSH access and you want to move sites around you can do it pretty fast with the following commands, also if you’re working with magento then you’ll find some of the commands in here can be quite the life saver in terms of saving time so you can find the exact things you’re looking for.
CD – CD is current directory, this is how you can control where to search. For example, if you’re in magento and looking for something which displays on the front end you’ll probably want to do the following : cd public_html/app/design/frontend/
GREP – GREP is a search tool which can be pretty amazing. This helps you find things you need, so if you’re looking for a div called mydiv you CD into the right location (like frontend so you’re not searching for too much) and then grep -R “mydiv” .
You do -R and . so ensure it’s a recursive search and you’re searching everywhere you need to. You also have to make sure you put the search in ” ”
If you want to zip up your site you can do that by running the following command : zip -r nameofzipfile .
You can download the entire database by running a similar command to the following : mysql -u USERNAME -p DATABASENAME > NAMEOFSQLFILEYOUWANT.sql
So now you might want to download the site you’ve just zipped and have it on your new site. This could be because you’ve made your site on a dev server and you’re moving it to a live one.
This can be done by doing the following : wget http://enterurlhereofdevsite.com/thisisthefile.zip
This is quite similar to downloading the database in the first place, but instead of > you use < so…. : mysql -u USERNAME -p DATABASENAME < NAMEOFSQLFILEYOUWANT.sql
I will publish more as I think of them, or if anyone requests anything.
After artefact 4 I was left with lots of questions. Namely the above, What really matters when it comes to Ecommerce? Is it a collection of a lot of minor things? Is it the design? Is it the Brand? Is it having a physical Location? I set to find out…
My first test was the SEO test. I took a google search for ‘Playstation Vita’ and altered the results slightly. Putting a relatively unheard of company first, a large but purely online company second and a large company with physical locations third.
I then asked those involved in my test to select which company they would choose. I opted to keep the paid for ads in the same order as they appeared in my search to keep fairness (not realising at first that amazon was actually up twice now). I had 15 people to ask which they would choose, out of everyone those who when questioned used the internet and search engines regularly completely dismissed the paid for ads. Those who opted to select “rarely or never” also seemed wary of the top selection. Though it out of 4 who selected rarely / never use the internet/search engines 2 selected ‘Asda’ as their first choice.
In order of preference this is the list of selections:
Next I chose to do a ‘cheap’ test. This focusing on the idea that people don’t really care where they buy from but choose the cheapest option when it comes to a product that has no real varient (for example, if you searched for “cups” then you may get varying quality, this test was designed to focus on a product which had no varient in quality as its massed produced and branded)
Out of those 15 people those who were less confident on the internet and used it less chose the most expensive (all four chose argos). Those who selected that they had reasonable knowledge of the internet and used it ‘semi often’ opted for amazon and those who had selected a high knowledge of the internet and daily usage opted for the cheapest. This allowed me to recognise that there is a direct correlation between overall internet usage and confidence and that of how they shop.
Finally, I selected a location based check. In this system, I made all prices exactly the same. Removing the notion of cheaper / more expensive and kept the priorities. However, along with the images I gave the following back story :
“These three stores all offer the same product at the same price. They all have the same security certificates and have the same returns policy, they all have a method of contact and one company doesn’t have a call centre but responds to emails on average within 15 minutes. Argos has several stores around the country, Amazon doesn’t have any stores but has call centres based in the UK and abroad and the final company Vascade has no number to call but responds to emails very quickly. Out of all online research Vascade has the highest customer satisfaction rating but has the lowest number of reviews.”
I used the above statement to try and level out each company. I put vascade as the highest satisfaction but the lowest reviews, meaning they may very well be the best company but with argos having more reviews and more custom this can’t be certain. This allowed me to best check whether a physical location actually matters.
Out of the above, the results stayed quite consistant to the cheap test. Those who had the lowest amount of internet usage and confidence opted for Argos, a well established company with physical locations and call centres. Those who used the internet reasonably often opted for Amazon, no physical location but they’ve built a high level of trust and offer good telephone based customer service. But, this is where it split somewhat. There was actually less people who opted for the unheard of company, and this was purely down to having no telephone number and only online communication. This was quite surprising but then quite understandable as it removes an extra level of ‘security’ in the mind of the customer.
In conclusion, I discovered that SEO has probably the least amount of influence on potential customers. It has quite a high amount of influence for the first page, (i.e. anything beyond the first page is pretty much not going to get looked at) but beyond that it doesn’t seem to do much. I noted as well that when questioned most people did say they normally open every site on the first page when looking for a product. Brand also didn’t seem to matter hugely when it came to buying other branded goods, it would seem that most people who used the internet quite often and actually used ecommerce (most of those who rarely used the internet indicated they very very rarely actually purchase from it) didn’t mind buying from a relatively unheard of company, but some kind of human based communication did seem to be the deciding factor.
I have concluded from all of my artefacts that design is important, usability is important but without human interaction (at some degree) and it seems a strong brand basis an ecommerce site struggles.
We all assume that the most important thing in ecommerce is security.. Right? Well, to test this assumption I took popular website Argos and tweaked the website slightly to imply it wasn’t safe [Note, this is photoshop the site is actually safe and secure, no suing please argos!]. I then took the same layout/design/etc and made a random store, this ensured that it was as close as possible so that design and layout etc wouldn’t alter the results.
The left is the real argos site, with no tweaking. The second is the random company site. When asked, people preferred site one to site two due to familiarity and a knowledge of the company. It didn’t seem to matter that the sites seemed to be the same, but actually that the argos logo was present.
Next I showed the same product, from the same page, with the logo changed and argos removed. Again, people wanted to buy from Argos not the made up company. When questioned it again was due to the familiarity and knowledge of the company. Neither site up until this point referenced security.
Now, I showed them the beginnings of the checkout, I added an unsafe HTTPS sign into the navigation and removed any reference to secure checkout. The random store showed secure HTTPS and secure symbols and verified etc. At this point, I expected to see a giant sway to the unknown company, but again there was little budge in which company those questioned preferred.
I concluded from this experiment and from questioning, that people were in fact prepared to overlook discrepancies in security when it comes to seeing a familiar brand. I honestly did not expect this, and has caused more questions to be raised in regard to how I proceed since my question is essentially relating to how people can get more purchases from customers. If the only thing people are interested in is familiarity then does anything else really matter? Artefact 5 will hopefully answer!
For my third Artefact I decided that I was steer a little further away from pure research and questioning and do something a little different. This artefact looks at whether a drop down navigation (or static header nav) is actually necessary in modern ecommerce or not.
I began this by asking a selection of people (10) if they would take my screen shots and see which mode they preferred.
Screen 1, or screen 2.
It was decided that people preferred image 1. Which process will be referred to as “nav” instead of image 2 (called “no-nav”)
I then asked each person if they could find the quickest route to find me an Asus brand laptop over £500. The first image people used the navigation, selecting “laptop” (see below image)
Then, I asked them to do the same with no-nav which people simply entered “asus laptop” into the search, below is screen shots of the next process.
At this point I requestioned which was preferred, this leant to a slight majority vote toward no-nav (3 to 2), this causes me to believe that people find the idea of a navigation system to be a ‘comfort’ but when used it’s actually sometimes quite a hinderance. Developing this further, The users then proceeded to find the laptop in question
This finished by me finding that no-nav took three steps to find the product, it could have been found quicker possibly just searching for asus laptop and then scrolling but in the interest in fairness I equalled them out as much as possible. For the nav option to gain ground and become equal to the search option you would need to introduce almost every combination of product in terms of brand, size, colour, product etc and set them as categories. Which would cause the navigation to be somewhat ridiculously oversized.
In conclusion I have discovered that the navigation does offer somewhat a ‘safety net’ to people, and also offers a nice method of searching for those people who aren’t sure what they want but merely want to look around. For example, a home interiors store should keep the navigational system as a lot of people will go to the site thinking “I want to decorate my [insert room here] lets see what they have” rather than always wanting to find specifics. But what this does however, is drive home the point that a good search system is vital when it comes to ecommerce.
In order to further discover how e-commerce sites can differentiate themselves from the plethora of online stores out there my third artefact was to delve into the quirky and unique attributes that a site can give its self in order to stand out from the crowd.
I began the research by trawling through websites and found that I wanted to discover more about the level of mobile design and development used. I especially wanted this as it is a part of my client project (not confirmed but as an additional feature if there’s time at the end) so I wanted to further my knowledge about mobile development and whether it is a good solution.
I began by searching out a few companies that have a mobile version of their online store. I looked at the top ten on http://www.practicalecommerce.com/articles/2601-10-Effective-Mobile-Ecommerce-Designs and also looked at Very and Tesco.
I had noticed that all mobile ecommerce sites had a tendency to look the same. That being small amounts of images, little in terms of design and little to no movement in the design (by movement I mean, moving on mouse over, animation etc). Information is also reduced, showing the bare minimum in regard to what information is displayed. It would seem mobile sites are for those strictly who know exactly what they want rather than a casual scroll around / research.
I introduced to this a questionnaire which asked the following questions:
From the above questions I found the following:
When further questioned I discovered that mobile sites seem to make no difference whats so ever when it comes to use for ecommerce. I decided to use this information to inform my client and we agreed to not proceed with the idea. I had also discovered that people feel untrusting in regard to mobiles still and using them for anything other than simple browsing.
Because of this my next artefact will be building on this concept to further discover what unique attributes can ensure sales and whether the genre of store plays an integral role in these concepts.
It was suggested that we should have a Gantt chart system to keep track of our work, and to allow our client to see where we should be at. I chose not to do this and this post explains why…
A gantt chart is great when you have to be very well structured, when certain things HAVE to be done and when you can have a nice chronological order to everything you’re creating. The web, unfortunately, is not like that. There’s times I’m sure in every developers career where they have completed a page and begun on another but something like javascript has messed up the original page? (Or maybe it’s just me) But, this is why I don’t browser test until the entire site is done. I keep I.E stylesheets separate so they don’t bug out the rest of my work and generally I have a method behind how I do things.
Therefore, a gantt chart, for me at least won’t work. If I try and say development has to be done by X and front end design/development has to be done by Y this limits me hugely. Obviously I have to have the design signed off before I can start but that doesn’t need a gantt chart. Instead I use an awesome piece of software called active collab. This allows me to set up a project, give myself deadlines, and give access to my client who can browse the site on various machines, at various times and add tickets for me to complete. The ticket system means that I essentially have someone checking my work all the time. The ticket system also means that browser testing becomes minimal at the end because I’ve been made aware of issues as I go along.
I also used active as a way for my client to see exactly where I am at. It shows what issues I know about, what issues I’ve fixed (or think I’ve fixed), what stage of development I have done and what is left. I can also see what I wanted to have done and how far in front (or behind) I am. I’ve also added tickets for my client to do such as sending me various pieces of information and product data.
All in all, it gives me everything a Gantt chart does, but its dynamic, it can change as I do and warn me if I overlook issues. Brilliant.