Thứ Ba, 8 tháng 1, 2013

How To Create CSS Image Buttons In Your Magento Themes


Many developers and store owners don’t like to use images as buttons simply because they do not wish their users to wait until the images load. Image buttons gives the flexibility to display images as per store’s requirement but these days lots and lots of stores are opting to create CSS image buttons rather than image buttons. With a very little tweak you can get rid of image buttons in your theme and switch to CSS buttons. If you are willing to change your image buttons to CSS powered buttons then follow the steps given below:


Take a nice background image which is blank and nothing written on it. We will use this background image to generate text over it. Basically, if you follow CSS buttons you don’t have to create separate images for each button. Download the background image given below for an example (you can create your own image background).
In your magento themes you will find various instances where you have to change image button to CSS button. For an example we will take “Proceed to Checkout” button code app/design/frontend/default/Your_theme/template/checkout/onepage/link.phtml
By default you will see something like this (if you are using default theme)
<a href="/"><img src="/" alt=""/></a>
Now, we will use CSS and HTML to tweak and change the background for this button.
<a class="css-button btn-checkout" href="/"><span><?php echo Mage::helper('checkout')->__('Proceed to Checkout');?></span></a>
Note: if you are using v 1.7 then change like this
<a class="css-button btn-checkout" href="/"><span><?php echo $this->__('Proceed to Checkout')?></span></a>
You will notice that we have called css-button class along with btn-checkout which will enable us to change font color or size later if needed. Your CSS button is ready. Now, lets write the CSS for this button
.btn-checkout {
display:block;
float:right;
background:transparent url(../images/btn_proceed_to_checkout_rad.gif) no-repeat 100% 0;
font-size:15px;
font-weight:bold;
padding-right:8px;
}
.btn-checkout, .btn-checkout:hover {
color:#fef5e5;
text-decoration:none;
}
.btn-checkout span {
display:block;
padding:0 17px 0 25px;
background:transparent url(../images/btn_proceed_to_checkout_bg.gif) no-repeat;
line-height:40px;
}
You are done, your CSS button is ready, just clear your cache and see the CSS button.
Similarly, you can change the buttons of other instances like Add To Cart etc. E.g. app/design/frontend/default/your_theme/template/checkout/onepage/review.phtml
change this
<input type="image" src="/" onclick="review.save();" value="" />
To
<a class="css-button btn-checkout" href="#" onclick="review.save();"><span><?php echo $this->__('Place Order') ;?></span></a>
Changing image buttons to CSS buttons is an easy task if you follow the steps given above but make sure that you switch to all instances of image buttons to CSS one’s otherwise your store might look awkward. Please leave me a comment and let me know if this trick helped you to convert your Magento store image buttons to CSS buttons. Don’t forget to subscribe our RSS to receive latest updates delivered to your mailbox.

How To Add Lightbox To Magento Theme


Have you ever wondered how people are showing larger images for products on mouseover or mouse click using lightbox (very popular JavaScript library). Adding Lightbox to your magento theme is not difficult and by adding very little code to your theme you can get the Lightbox functionality easily. Lightbox will give the ability to highlight your products by showing lager image of the product along with brief description. Our approach will be based on default layout, you can change the theme name based on your selection.

Steps To Add Lightbox To Magento Theme (Prerequisites)

Following are the steps to add Lightbox to your Magento Theme
  1. Download Lightbox from here
  2. Make a directory called /lightbox under /skin/frontend/default/default/js/ and copy the entire lighbox code under that directory. Once done, your directory will look like /skin/frontend/default/default/js/lightbox (all code under this directory)
  3. copy the lightbox.js under /magento/js/lightbox (create a folder under js directory and name it lightbox). If you installation is under root directory then copy it under /root/js/lightbox
  4. Now, you should copy the lightbox.css to /skin/frontend/default/default/css directory.
  5. Create a folder called lightbox under /skin/frontend/default/default/images. Your directories for images will finally look like /skin/frontend/default/default/images/lightbox. Copy all the images from source lightbox directory here.

Changing Lightbox default’s As Per Your Magento Theme

Lightbox is free open source JavaScript library to suit any kind of environment. In order to use Lightbox with Magento we have to change few default settings by assigning your theme’s original path. Following are few changes which you have to make in order to install Lightbox with your Magento theme installation.

How To Change Image Directory Location Of The Lightbox

Soon after you are done with the above pre-requisites change the following code by editing /skin/frontend/default/default/css/lightbox.css
find the following line of code
background: transparent url(../images/blank.gif) no-repeat;
and replace it with
background: transparent url(../images/lightbox/blank.gif) no-repeat;
Now find the following line of code
#prevLink:hover, #prevLink:visited:hover { background: url(../images/prevlabel.gif) left 15% no-repeat; }
and replace it with
#prevLink:hover, #prevLink:visited:hover { background: url(../images/lightbox/prevlabel.gif) left 15% no-repeat; }
Find the following line of code
#nextLink:hover, #nextLink:visited:hover { background: url(../images/nextlabel.gif) right 15% no-repeat; }
and replace it with
#nextLink:hover, #nextLink:visited:hover { background: url(../images/lightbox/nextlabel.gif) right 15% no-repeat; }
Now, lets make few changes in the lighbox.js file which will be found under /skin/frontend/default/default/js/lightbox/lightbox.js
Edit this JS file with your favorite editor and find the following line of code
fileLoadingImage: 'images/loading.gif',
fileBottomNavCloseImage: 'images/closelabel.gif',
and replace these lines with this
fileLoadingImage: SKIN_URL + 'images/lightbox/loading.gif',
fileBottomNavCloseImage: SKIN_URL + 'images/lightbox/closelabel.gif',
Now, change the head.phtml file which will be found under /app/design/frontend/default/default/template/page/html/head.phtml
Edit this file using your favorite editor and find the following line of code
<script type="text/javascript">var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
var BLANK_IMG = '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
</script>
replace this code with the following line of code
<script type="text/javascript">var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
var BLANK_IMG = '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
var SKIN_URL = '<?php echo $this->helper('core/js')->getJsSkinUrl('') ?>';</script>

Adding Stylesheet & JavaScript To Your Magento Installation

Open page.xml from /app/design/frontend/default/default/layout/page.xml using your favorite editor.
Under the following line of code
<block type="page/html_head" name="head" as="head">
....
</block>
Add this
<action method="addItem"><type>skin_js</type><name>js/lightbox/lightbox.js</name></action>
<action method="addCss"><stylesheet>css/lightbox.css</stylesheet></action>
AFTER the prototype.js. It is recommended to add the two lines where the list of js and css files intersect so it will look something like this:
     ...
<action method="addJs"><script>mage/cookies.js</script></action>
<action method="addItem"><type>skin_js</type><name>js/lightbox/lightbox.js</name></action>
<action method="addCss"><stylesheet>css/lightbox.css</stylesheet></action>
<action method="addCss"><stylesheet>css/reset.css</stylesheet></action
...

How To Add Lightbox To Magento Product Detail Page

Edit media.phtml from /app/design/frontend/default/default/template/catalog/product/view/media.phtml using your favorite editor
Find the following line of code
<?php foreach ($this->getGalleryImages() as $_image): ?>
<li><a href="#" onclick="popWin('', 'gallery', 'scrollbars=yes,width=200,height=200,resizable=yes');return false;">
<img src="/" alt="" title=""/></a>
</li>
<?php endforeach; ?>
and replace the above lines with this
<?php foreach ($this->getGalleryImages() as $_image): ?>
<li><a href="/" rel="lightbox[rotation]" title=""><img src="/" width="68" height="68" alt=""/></a>
</li>
<?php endforeach; ?>
Now, you are all set. You will see the Lightbox opening up for your product images. Leave me a comment and let me know if you run into any difficulty.

MT Slideshow setup userguide

MT Slideshow setup userguide


magento slideshow
In this tutorial, we will show you how to setup and configure the MT Slideshow extension
Step 1: Download MT Slideshow package .zip file from download section.
Step 2: Uncompress it (you can use winrar or winzip to uncompress files on windows machine or use unzip zipfilename.zip to uncompress files on Linux server)
Step 3: Using your FTP client to upload 'app', ‘media’, ‘skin’ and ‘js’ directories to your store root. This would not overwrite any file, just adding the extension to its folder.
Step 4: Enable / Disable MT SlideShow
Go to System -> MagenThemes -> MT SlideShow -> Configuration, you can see a field setting named ‘Enable’, choose ‘Yes’ to use MT SlideShow. Then click Save Config to save your change.
Step 5: Add Slide
Go to MagenThemes -> MT SlideShow -> Manage SlideShow, click “Add Slide” button
A. Slide information:
+ Identifier: set unique identifier for your slideshow, ex: slideshow1
+ Position: select the position which you want to show your slideshow.
+ Status: Enable
B. Image:
+ browse to your images and press Upload button to upload them.
+ Fill all information for your images slideshow: title, image link, description
C. Display on Category / Display on CMS page: select the category and cms page which you want to disable the slideshow
After all above task done, press the Save button.
Step 6: Refresh the front-end of your store to see how it work.

MT Product setup and configure guide

MT Product setup and configure guide


In this tutorial, we will show you how to setup and configure the MT Products extension
Step 1: Download MT Product package .zip file from download section.
Step 2: Uncompress it (you can use winrar or winzip to uncompress files on windows machine or use unzip zipfilename.zip to uncompress files on Linux server)
Step 3: Using your FTP client to upload 'app', ‘media’, ‘skin’ and ‘js’ directories to your store root. This would not overwrite any file, just adding the extension to its folder.
magento products list
Step 4: Enable / Disable MT Products
Go to System -> MagenThemes -> MT Products -> Configuration, you can see a field setting named ‘Enable’, choose ‘Yes’ to use MT Products. Then click Save Config to save your change.
Step 5: Add MT Product List to the home page
To setup your homepage, you will need to go to (CMS → Manage Pages). Select "Home Page", with the identifier as "home". Scroll down and look for "Content", inside that you will have to input your homepage code. Please copy and paste the code below:
{{block type="mtproducts/MtProducts" before="-" name="mtproducts" template="magenthemes/mtproducts/mtproducts.phtml"}}
After all above task done, press the Save button.
Step 6: Refresh the front-end of your store to see how it work.

Basic SSH Commands for Magento Developers

Basic SSH Commands for Magento Developers


During my long time developing with Magento I’ve very rarely had to use SSH to make changes to the server environment for the benefit of my store. However, as you look around the Internet it quickly becomes apparent that Magento can make real use of actions provided by shell. Some examples are:
  • Setting up Magento on multiple domains with SSL certificates
  • Installing / upgrading Magento
  • Installing extensions
  • Resetting file permissions
ssh commands
I’m not going to go into how to do all these things because it’s documented very well on the Internet already. However with my experience, here’s a few basic SSH commands a Magento Developer should know before going in with shell.

Navigating Folders

ls 
List all items in current directory
cd foldername 
Change directory to specified folder name (e.g cd httpdocs/downloader)

Creating Editing Files

vim filename
Create specified file in current directory (e.g vim vhost.conf)
vi filename
Go into and edit the specified file (e.g vi vhost.conf)
Esc + :wq 
Save and quit when you’re editing a file, press Escape key followed by :wq to get out of file editing mode.

Removing Copying Files

rm filename
Deletes the file specified within current folder (e.g rm vhost.conf)
rmdir
Removes the specified directory (e.g rmdir /httpdocs/var/session)
cp filename
Copies the file specified within current folder (e.g cp vhost.conf)
cp –a /var/www/public_html/* /var/www/public_ftp/
Copies all files from one directory into a new specified directory (e.g above all files from public_html go into public_ftp)
This is all stuff that helped me out so hopefully it will for you too. My one word of caution will be to be very careful when creating important server files in shell, as one wrong move can bring your server down. You often need to restart your server after making such changes, so remember to do that after you’re done.

Magento’s Three Milestones

Magento’s Three Milestones

I’d just like to take a few moments to comment on Roy Rubin’s official post about Magento’s 3-year anniversary. Read article here… There certainly seems to be a lot of fascination over the number 3 for Magento on it’s third birthday. Here’s why:
  • Magento was released on the 31st of the 3rd month, 3 years ago
  • Magento has had over 3 million downloads!
  • Magento has over 3 thousand extensions
In that 3 years, there’s also 3 editions of Magento available (Community, Professional Enterprise), and there’s also 3 versions of Magento (Magento Commerce, Magento Mobile Magento Go). Also if you rotate the Magento logo 90 degrees clockwise, the ‘M’ becomes ’3′. OMG!!1!
Before I start thinking with the same numeric obsessive compulsiveness as Jim Carrey in the Number 23, I’ll drop the figures and focus on Magento’s biggest achievement: the Magento community.
The beauty of open source is the fact that anyone can contribute to it, and therefore everyone can feel like a part of its success. Magento has brought together developers from all over the world, and we all have the same goal: to have the best and most flexible ecommerce system available. I’ve been in touch with a large number of developers since beginning with Magento over two years ago, and the selfless attitude of many of the people I have spoken to is remarkable.
If Magento was an off-the-shelf solution it would still be a great product, but without the strength of the Magento community behind it there would never have been the same driving force behind its success.
I hope the community continues to grow in the next 3 years as the Magento product matures and firmly establishes itself in the mobile market. It means that there will never be a ‘finished product’. Hence the tagline: “Ecommerce Software for Growth”…

Thứ Ba, 13 tháng 11, 2012

Website Design

Website Design: We build fast, interactive, great looking, websites. All of our website design projects include a content management system to easily update your website on your own. You can be confident that whatever your project demands, our web designers can deliver pixel perfect designs on time and on budget. Go to Website Design.




Graphic Design: We collaborate with you to create a unique company identity for online and print publishing, helping you to stand out among the crowd. We offer logo design, graphic design, brochures, business cards, and complete corporate identity packages to establish your brand in the marketplace. Go to Graphic Design.

Website Hosting: Complete website hosting and email services includes gigabytes of space, plenty of bandwidth,and a personal account representative to assist you with any support questions you may have. Go to Website Hosting. For ideas on what webhosting sites have to offer and how they measure up, webhostingchoice.com compares the top ten.