Truck Equipment

Transfer Entire Site From One Server To Another Using SSH

This will start as a partial post regarding transferring a complete site from one server to another using SSH or how to copy files from one server to another using SSH. This outline is intended to be helpful for Magento users that may be transferring their Magento Commerce site from one server to another, but obviously these directions work for moving any kind of directories or website files.

First, you need to login to the server you want to transfer the files from using SSH.

You then need to login as a super user using the command line prompt: su

Enter the super user password.

Navigate using cd to your directory you want to backup, copy or move.

Use this command: tar -cpzf magento-3810.tar.gz ./

This creates a complete tar.gz file of all files and directories in your directory.

I use this procedure because I want to make sure I’m doing everything correctly. You could actually transfer the entire site from one server to another, but if you’re working with live sites or have a lot of work involved without a full backup, you want to have some feeling of security.

So next, I FTP to my server where I just created the tar.gz file and transfer that file to my local machine. I then unzip and untar the file and have a look over things just to be safe.

I then, trnasfer by FTP the same tar.gz file over to my new server directory.

Now, that tar.gz file is on the new server.

Go back to your shell screen.

Navigate to where you just put that backup file.

Use this command to untar the whole thing:

Park City Real Estate Website and IDX Integration

If you’ve never done any work on a real estate website, I have to say, you may want to think about it again. This is one we’ve been involved in developing for a Park City Utah Real Estate Agent. The real estate market is extremely guarded by the companies that specialize in real estate websites. It’s amazing what some of these companies charge for real estate websites, even though it’s not rocket science. The biggest hurdle is getting an IDX or RETS feed on the website. Most companies that provide an IDX solution apparently think there code is gold, and apparently it is. We’ve talked with some of these companies that want $350.00 / month just to provide the software that serves up the data feed, and they require you to host your site on their server since they don’t want anyone stealing their code. Then, there’s the frameset method, which is just the other companies website framed into your website, therefore giving them all the benefits of SEO, while getting nothing for the hosts real estate website.

I know I sound like I’m ranting and I suppose I am. If anyone out there knows of a good solution for IDX feeds for Real Estate Websites, feel free to add your comments here.

How To Change Callouts in Magento

Here is an easy way to change your left column callouts in Magento. Convert the callouts from a template file item to a CMS Static Block. The static blocks are stored in the database, not as files on the server so updates and changes are much easier.

The Magento demo store has a couple of static block examples. Log in as admin to see them. I think the home page has the “New Products” block, which is pretty useful and shows the syntax for how to use a block in a page.

In Magento,  callouts are hardcoded in the default layout xml to be files on your server. What you want to do is change them to static blocks instead, so you can manipulate them in the admin instead of in the layout files.

Here’s what to do:

In the default theme, the catalog.xml file has this for the left callout: By the way, catalog.xml is in the folder – app/design/frontend/*/*/layout/

<reference name=”left”>

<block type=”core/template” name=”left.permanent.callout” template=”callouts/left_col.phtml”>

<action method=”setImgSrc”><src>images/media/col_left_callout.jpg</src></action>

<action method=”setImgAlt” translate=”alt” module=”catalog”><alt>Our customer service is available 24/7. Call us at (800) DEMO-NUMBER.</alt></action>

<action method=”setLinkUrl”><url>checkout/cart</url></action>

</block>

</reference>

Changed it to this code below. This is just a basic implementation, you can make it whatever you want.:

<reference name=”left”>

<block type=”cms/block” name=”left.permanent.callout”>

<action method=”setBlockId”><block_id>left_column_block</block_id></action>

</block>

</reference>

Next, add a CMS Static Block with an ID of left_column_block. You can put whatever you want in there from the backend (including empty) and it will show in the left column. You can do the same thing with the right column, and can add more in strategic places for future editing in the backend. Good news is, even if you have not created the static block yet, you won’t get any errors.

So there you go, how to change callouts in Magento the easy way.

How to add attributes to product grid or list view in category in Magento Commerce

How to add attributes to product grid or list view in category in Magento Commerce

There is actually a post on the Magento wiki that addresses how to add attributes to product grid or list view in category in Magento Commerce, but when we tried to do it, we came up with no results. After trying many different methods resulting in either no results or Magento error messages, we finally came up with this solution.

  1. First create your new attribute field in Magento Admin.
  2. Note what you name the new attribute field “code”. In our case, the attribute is names “freeshipping”.
  3. When you define this in the code side of Magento in the following steps, keep in mind you have to call it up with each word being capatalized, in this case it would be “FreeShipping”. (Don’t use the quotation marks I added unless you see them in the example code.)
  4. Open app/design/frontend/default/yourtheme/layout/catalog.xml
  5. Find the line that reads: <block type=”catalog/category_view” name=”category.products” template=”catalog/category/view.phtml”><block type=”catalog/product_list” name=”product_list” template=”catalog/product/list.phtml”><block type=”catalog/product_list_toolbar” name=”product_list_toolbar” template=”catalog/product/list/toolbar.phtml”>
  6. Change it to read something like this:<block type=”catalog/category_view” name=”category.products” template=”catalog/category/view.phtml”><block type=”catalog/product_list” name=”product_list” template=”catalog/product/list.phtml”><!–I added–><action method=”addAttribute”><name>FreeShipping</name></action><block type=”catalog/product_list_toolbar” name=”product_list_toolbar” template=”catalog/product/list/toolbar.phtml”>
  7. Next find the line in the same file that reads: <block type=”catalog/category_view” name=”category.products” template=”catalog/category/view.phtml”><block type=”catalog/product_list” name=”product_list” template=”catalog/product/list.phtml”><block type=”catalog/product_list_toolbar” name=”product_list_toolbar” template=”catalog/product/list/toolbar.phtml”>
  8. Change it to read something like:<block type=”catalog/category_view” name=”category.products” template=”catalog/category/view.phtml”><block type=”catalog/product_list” name=”product_list” template=”catalog/product/list.phtml”><!–kj added–><action method=”addAttribute”><name>FreeShipping</name></action><block type=”catalog/product_list_toolbar” name=”product_list_toolbar” template=”catalog/product/list/toolbar.phtml”>
  9. Save the file.
  10. Open app/design/frontend/default/yourtheme/template/catalog/product/list.phtml
  11. Insert a line of code like this where you want it to appear: <p><h4> <?php echo ($_product->getFreeshipping()) ?></h4></p><p><h4 class=”product-free-ship”> <?php echo ($_product->getFreeshipping()) ?></h4></p>
  12. You’ll need to do this twice, once for “List View” and once for “Grid View”
  13. Save the file.
  14. Refresh your Magento Cache. You should now see your new entries including your Magento attributes.