Rss Feed Tweeter button Facebook button Technorati button Reddit button Myspace button Delicious button Digg button

How to add Google Plus One to Magento in 5 Easy Steps

Google plus1 and Magento

Google +1 and Magento

At present it is not clear what effect Google’s Plus 1 will have on search engine positions for your Magento store. As Google move towards more on-site content driven SERP’s, I believe it will become more important in the future so we may as well start now.

      1. add google plus1Log in to Google webmaster tools and get the +1 code (its where you would manage your sitemaps) as pictured.
      2. Design your +1 button then grab the java-script code that generates the button.
      3. Paste the code into your Magento store: System> Configuration> Design> HTML Head> Miscellaneous Scripts
      4. Insert the snippet where you want the button to display in your store. I position it in an unused space on the menu bar, or you could move it up into the header.
        If you wish to do the same the file to edit is: app/design/frontend/default/YOURtempleNAME/template/page/html/header.phtml
        The code I use is:
        <span id=”plusone”> optional text <g:plusone annotation=”none”></g:plusone></span>
      5. I give it an ID so i can use CSS to position the button. In my stylesheet i have:

        #plusone { float:right; position: relative; top:-25px;}

 Magento Extension

There is a free magento extension which you can get through magento connect but in my opinon it is poorly designed. While it does work, the +1 button is placed right next to the shopping cart. This may confuse people who do not know about +1 and think that +1 will add one item to the shopping cart. Anything that distracts the customer and complicates checkout should be avoided.

It is not difficult to do yourself, please ensure it is placed in a distinctive area of your store so it is clear that it is an optional extra rather than part of the magento checkout process.

Multiple Magento Sites with Wildcard SSL

Magento Multiple Websites

I have moved hosts and am in the process of setting up three Magento stores running off of one installation of Magento, one IP and one wildcard SSL.

Previously I used addon domains and ran them as separate websites in Magento.

However, using one IP and SSL certificate this will not work as each would need their own IP address to run as an independent website.

If you want to do this perhaps you may as well get 3 cheap SSL certificates and run them separately? This would of course negate any benefit from Magento’s multiple site ability and make 3 times the work.

Magento and Parked Domains

Now the stores are set up with allgiftsdirect.co.uk as the main domain and the other two as parked domains. This allows the other websites to share the main websites information but requires no extra folders or files. It also proved to be more straightforward to initiate the change in stores using the parked domain method.

Of course nothing in Magento is ever straightforward, using a set up of multiple websites did not work. When purchasing in one website and then going to checkout using the wildcard SSL on the main site, the cookie for the shopping basket would not carry over. There would be an error about ‘your shopping cart is empty’. After trying different cookie settings it still did not work so I switched to using one Magento website.

Magento Stores

I am now running the configuration ‘A’ on the left (but with 3 stores). I have one website with 3 magento stores, each with their own store view.

This allows the swapping of customer accounts, shopping baskets and store switching.

Plus,  I am able to use the wildcard SSL so customers can use the checkout and customer login at summerinflatables.allgiftsdirect.co.uk and access the store with summerinflatables.com.

Most templates also have a store switcher so going back and forth between the different stores should be easy.

If you are not sure about the difference in Magento between stores, websites and store views please click the picture above for more information from the magento commerce website.

The only drawback is that any SSL pages are served on the main website using that template. I therefore need to create a uniform look for customer pages and the checkout so it matches all the stores. The would prevent customers from being concerned they are being redirected to a completely different site and make it clear all the stores are part of the same group.

Magento Mass Exclude Images

By default Magento will exclude imported images so they do not show up multiple times on the front end.

This is how i wanted it but unfortunately if you add another shop the auto exclude no longer works.

To mass exclude images via SQL simply execute:

UPDATE`catalog_product_entity_media_gallery_value` SET `disabled` = ’1′ WHERE `disabled` = ’0′

Alternatively if you want to turn off the exclude function:

UPDATE`catalog_product_entity_media_gallery_value` SET `disabled` = ’0′ WHERE `disabled` = ’1′

 

Magento Setting Up The Find Feed

Ensure you set up the free product feed from The Find. It is worth doing, here’s how:

————————————————————

UPDATE:

I no longer use Magneto’s built in feeder. With different errors occurring and the number of products that are accepted changing on a seemingly random daily basis I have concluded that it is not worth the time invested.

As Google shopping  has now changed the way they accept products I now create my own base text file and tell The Find to use that one. I used the gbase.php method as illustrated here.

The text below has been left for reference – it might come in useful again one day:

————————————————————

Setting Up Attributes:

Magento Menu: Catalog > The Find Feed > Manage Attributes

These are the minimum you will need to add.

  • Title
  • Description
  • Price
  • Page_Url
  • Image_Link

For the initial upload I recommend having only the very basic fields.

Later, when the feed is working you could add additional fields one at a time to ensure they are not the cause of any errors.

If you have more then add them manually. Select add new. The first drop down selector is The Find’s field, the second is from Magento. For example if you use manufacturer information then select Brand in the first option and manufacturer in the second. Mine is shown below:

The Find Feed Attributes

 

When you have finished choosing your attributes, select all to tick the boxes then on the top right of the screen select import and click submit.

 

Setting Up Items:

Magento Menu: Catalog > The Find Feed > Manage Items.

Simply select all, choose publish and click submit. All your items are now included.

 

The Find Merchant Settings:

Log into The Find and select the menu Product Feed Upload from the left bar.

Use feed format: The Find and file type text. This is mine :

 

Notice the FTP settings button at the bottom of the pic? That is where TheFind gives your user name and password for the feed.

Click on it, get your username and select a password.

When you have that its time to set up Magento.

 

Set up Magento FTP:

Magento Menu: System > Configuration >The Find Feed.

FTP Server : ftp.thefind.com

FTP Path: /

FTP User: ftp-yourusername

TheFind Feed Filename: feed

FTP Password: whatever you just selected at the find merchant centre.

Update TheFind Item when Product is Updated: i chose yes

Cron Frequency: Daily

Cron Hour: pick a time.

Change to File Storage:

Dashboard > System > Configuration > System > Storage Configuration for Media

  • Set to Database
  • default_setup
  • synchronize then save config

This will create temporary directories in your database core_file_storage and core_directory_storage. As far as i can tell this is used to compile the photos for the feed.

Run Cron Job

Now you need to schedule cron jobs (if you don’t already have them running) by periodically running cron.php. I use cron jobs from my host but there are various ways to do this. Additionally I use a Magento extension, Noovias Cronjob Manager, which displays all current and historical cron jobs in admin and is free from Magento Connect.

You can check if it items are scheduled to run by using the above extension or browsing the field cron_schedule in your database. The default settings in Magento clears the history log every 10 minutes so it is likely you will not get to see it. If you are unsure which cron settings to use I followed the guidelines from this post about setting up Magento cron jobs.

My cron job in Cpanel is this:

0,30 *  *   *   *  /bin/sh /home/USRNAME/public_html/cron.sh

or you could use something like /usr/bin/php -q /home/USRNAME/public_html/cron.php

FTP Functions:

Ensure the functions ftp_connect and ftp_login are available on your host. The default PHP setup may disable them. Configure php.ini or if you are on shared hosting ask support to make these two functions available.

It took me ages to figure all the above out and get it working but once running automatically it is worth it.

Good luck!

 

NB: It can take ages for your Magento feed to appear in The Find results.

I get emails daily from The Find about the number of products accepted and errors in the feed. Which products are accepted and what the errors are, unhelpfully, is not displayed. i started this article on 27th May and although the feed is accepted daily no new products are yet showing. Apparently 2-4 weeks is not an uncommon time to wait.

Magento Maintenance Tip

Regularly check your error logs.

If not enabled go to System > Configure > Developer > Log Settings

Enable them. They will appear in var/logs. If they do not then create a blank file called system.log and error.log.

If you do have errors then Google for them. Most are common and finding a fix is easy ( implementing the fix may not be so easy, this is Magento after all).

Additionally check the Magento forums and of course ask a question there if required.

 

Magento Checkout Out Confirm Order Button Missing Fix

The checkout layout has changed in Magento 1.5 so older templates will not work properly.

Customer gets all the way to stage 5 of the checkout and the ‘Place Order’ button never appears so they are unable to buy.

In Hellowired template simply add the line:

<block type=”core/template” name=”checkout.onepage.review.button” as=”button” template=”checkout/onepage/review/button.phtml”/>

to /app/design/frontend/default/hellowired/layout.checkout.xml around line 394 just before </block>
</checkout_onepage_review>

Magento Price and Stock Availability No Longer Showing

Encountered an error in Magento when price and stock availability no longer displayed in product view using Hellowired template.

After upgrading to 1.5, prices would show in the catalogue and grid views but on the product view the price and stock availability was not showing.

Found a fix for simple products after files have changed between Magento 1.4 and 1.5, Template/catalog/product/view/type/ simple.phtl is now deprecated and default.phtml used instead. Older templates need to be changed:

  • Located in /app/design/frontend/default/YOURTEMPLATE/layout
  • You need to change all instances in the file catalog.XML that point to simple.phtml and make it read default.phtml

I only have one instance around line 285.

Change template=”catalog/product/view/type/simple.phtml”>

to template=”catalog/product/view/type/default.phtml”>

While this needs to be done it made no difference for me and the price was still not showing. Ah, the joys of Magento!

Hopefully the above will fix your issue. If it didn’t carry on reading.

After a lot of digging around comparing two different templates I found a fix.

In Hellowired there was a slight difference in a file so I changed \hellowired\template\catalog\product\view.phtml

  • around line 61 <?php echo $this->getChildHtml(‘product_type_data’) ?>
  • to:                     <?php echo $this->getChildHtml(‘product_type_data_side’) ?>

 

I have yet to figure out why but it does work.