Monday, July 12, 2010

Fee jQuery eBook - 7/12 Only

Sitepoint is offering free download of the eBook jQuery: Novice to Ninja by Earle Castledine and Craig Sharkie here.

Amazon reviews are pretty good and the paper edition is priced at $35.60.

Tuesday, June 29, 2010

Magento - Change Price Labels

Magento by default labels the prices as "Regular Price" and "Special Price". I could not find any simple or straightforward method of changing these labels in the back-end admin.

It turns out that this is driven from the template's Price PHP file app/code/design/frontend/MYTHEME/template/catalog/product/price.phtml which reads the label values from the locale files and displays it.

So the simple solution is to change the label values in app/locale/en_US/Mage_catalog.cvs:
"Special Price:","Special Price:" 
to
"Special Price:","Our Special Price:" 

and

"Regular Price:","Regular Price:" 
to
"Regular Price:","Suggested Retail Price:" 

However, the recommended upgrade-proof method would be to create a new locale specific translation file containing only the above desired changes and save it as: app/design/frontend/MYTHEME/locale/en_US/translate.csv.

And don't forget to clear the cache after doing any of the above changes or they may not be visible on the front-end!

Similarly you can change any labels that you desire. Note that this is case-sensitive and needs to be done very carefully.

Magento - Ampersand in Category name not showing properly

Quite a few Categories added to a test install of Magento shopping cart had the ampersand character in the name. The Category page was displaying the ampersand in the name as & a m p ; which is the special HTML entity for the ampersand character.

I fiddled around with the settings in the back-end admin but there was no solution like the one I had stumbled upon for a similar problem in Product names here.

After a lot of fiddling, it turned out that this was happening because the category view PHP file for the theme I was using had compatibility issues with the instaleld cart version. The solution was to modify the app/design/frontend/MYTHEME/template/catalog/category/view.phtml as follows:

Search for occurrences the line:
<h2><?php echo $_helper->categoryAttribute($_category, $this->htmlEscape($_category->getName()), 'name') ?></h2> 

Replace with this line:
<h2><?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?></h2> 


Explanation:
We are changing the theme view code to not translate any characters in the name that may have a HTML Special Entity representation. So these will remain as they are and you will not see the names going haywire!

Note that this may need to be done in a different file depending on which of the files are causing this problem. The errant file could be an incompatible older version of a plug-in as well.

Magento - Ampersand in Product name not showing properly

Some of the products added to a test Magento cart had ampersand & character in the name. When viewing the product page for such products, the ampersand in the name was being shown as & a m p ; which is the special HTML entity for the ampersand character.

I was at a loss and almost on the verge of advising that Product name should not contain and special characters. However, while fiddling with the settings, I stumbled upon the setting in the attribute that allows HTML code in the name.

In the back-end admin, go to Catalog >> Attributes >> Manage Attributes menu and then click on the name attribute. Set the Allow HTML-tags on Front-end to Yes and you are all set to show ampersand and other special characters properly in the product name!

In fact, this same approach can be used for any field that is displaying such a similar behavior.

Magento - Invalid argument supplied for foreach in toolbar.phtml

After adding a new theme and uploading a big number of records to a fresh Magento install, I see the following error in the log files:

Invalid argument supplied for foreach() in /home/content/07/6268407/html/app/design/frontend/MYTHEME/template/catalog/product/list/toolbar.phtml on line 63

After much digging around, I realized that this error is due to change in Magento on how the pagination works now in 1.4 as compared to earlier versions. The theme I used was clearly not compatible with Magento1.4 and hence this issue. To resolve this problem, here are the steps I took:

1. Create Template file for Pagination
Create a new file for handling pagination according to the new way. Create a new file called pager.phtml in the /template/catalog/product/list/ folder inside your theme folder. Now write the below code into this new file:
<?php if($this->getCollection()->getSize()): ?>
        <?php if($this->getLastPageNum()>1): ?>
        <td class="pages">
            <strong><?php echo $this->__('Page:') ?></strong>
            <ol>
            <?php if (!$this->isFirstPage()): ?>
                <li><a href="<?php echo $this->getPreviousPageUrl() ?>"><img src="<?php echo $this->getSkinUrl('images/pager_arrow_left.gif') ?>" alt="<?php echo $this->__('Previous Page'); ?>" /></a></li>
            <?php endif ?>
            <?php foreach ($this->getPages() as $_page): ?>
                <?php if ($this->isPageCurrent($_page)): ?>
                    <li><span class="on"><?php echo $_page ?></span></li>
                <?php else: ?>
                    <li><a href="<?php echo $this->getPageUrl($_page) ?>"><?php echo $_page ?></a></li>
                <?php endif ?>
            <?php endforeach;; ?>
            <?php if (!$this->isLastPage()): ?>
                <li><a href="<?php echo $this->getNextPageUrl() ?>"><img src="<?php echo $this->getSkinUrl('images/pager_arrow_right.gif') ?>" alt="<?php echo $this->__('Next Page'); ?>" /></a></li>
            <?php endif ?>
            </ol>
        </td>
        <?php endif; ?>
<?php endif ?>

2. Call this Pagination code in Layout
Edit the catalog layout xml file to include this new pagination code. Open the file catalog.xml in the /layout/ folder inside your theme folder. Now search for this line of code:
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">

Below this line, add the following new line to call the pager file that you created in step 1 above:
<block type="page/html_pager" name="product_list_toolbar_pager" template="catalog/product/list/pager.phtml" />

3. Call this Pagination code in Toolbar
Edit the toolbar html file to include this new pagination code. Open the file toolbar.phtml in the /template/catalog/product/list/ folder inside your theme folder. Now search for the below block of code approximately around lines 42 - 63:
<?php if($this->getLastPageNum()>1 && is_array($this->getPages())): ?>
...
...
...
<?php endif; ?>

Now replace this block of code with the following single line of code:
<?php echo $this->getPagerHtml(); ?>


If you follow these 3 steps to the 'T' it should definitely resolve your problem!

To find out details of errors, please go through this post on Debugging Magento.

Monday, June 21, 2010

Logitech QuickCam Deluxe Webcam on Ubuntu 9.04

I suddenly realized that I had not used my Logitech QuickCam for Notebooks Deluxe Webcam on Ubuntu 9.04 till now! So I plugged it in and fired up Skype to do a Video Chat. To my pleasant surprise, it just worked right out of the box without requiring any tweaking, extra configuration or driver installation. The only thing that I had to do was to choose the Logitech devices as my Mic-In and Video-In devices.


Check out the specs & reviews of Logitech QuickCam for Notebooks Deluxe on Amazon:

Sony DSLR A230L Kit Refurb for 288 on SonyStyle

SonyStyle has a Refurbished Sony DSLR A230L for $288 with Free Shipping. The kit consists of Body having 10.2 Megapixel resolution & in-body image stabilization and 18-55 Standard Zoom Lens.

PROs:
  1. SteadyShot™ Image Stabilization in body
  2. HDMI Output
  3. Eye-Start™ Autofocus System
  4. Anti-Dust Technology helps keep the CCD imager clean
  5. Small & light body
  6. Accepts Memory Stick PRO Duo™, Memory Stick PRO-HG Duo™ and SD/SDHC media
  7. Very good for beginners
  8. Can shoot in RAW mode


CONs:
  1. Grip has been a major crib across the forums
  2. Included Lens is just about average
  3. Limited functionality for "PRO" users
  4. Average battery life
  5. Pop-up flash is front facing which may be disadvantageous
  6. Custom hot-shoe for external flash
  7. Average low-light performance

Verdict:

A good deal for the price especially for beginners, more so as it contains the lens as well.



For convenience, here's the direct link to DSLR-A230L on SonyStyle.



Check out the reviews and tech specs on Amazon:

Friday, June 18, 2010

Dell Outlet Laptops on Sale

Dell Outlet has a lot of good laptops & desktops with i3, i5 and i7 processors on sale right now.

Go to Dell Outlet and click on Home & Home Office link at the bottom right.
In the left menu, Check Availability & Prices section, select the product that you are interested in (laptop/desktop).
Select the Processor i3/i5/i7 with desired speed, uncheck Certified Refurbished (if not interested in Refurbished items) in the top center and click Filter Results. To sort by price low to high, click the Price column header.

Add desired item to your cart and then to make this deal sweeter, use coupon code
?C73C85JCXMXMG
for an extra 15% off - this coupon expires today. You will also get free 3-5 day ground shipping automatically for Dell Laptops from outlet store.

Check out the specs & reviews on Amazon:

Wednesday, June 16, 2010

Make your Blog Post Title SEO Friendly

By default, the Blog Post Title that Blogger creates has the Blog Name followed by the Post title. This is not so SEO Friendly and it determines how you your blog title is displayed in search results. Making it more relevant increases the chances of people clicking through your link and besides, doing this is really very simple!

Change Blog Post Title
  1. Go to Design > Edit HTML in your Dashboard
  2. Search for:
    <title><data:blog.pageTitle/></title>
  3. Replace it with:
    <b:if cond='data:blog.pageType == "index"'> 
      <title><data:blog.title/></title>
    <b:else/> 
      <title><data:blog.pageName/> | <data:blog.title/></title> 
    </b:if>
    
  4. Save the Template

Note: The changes on your Blog will be immediate, but the results to show up on the search engines may take up time depending on how they spider and change their databases.

Jamba Juice for a Dollar - 16 June 2010

Today Jamba Juice is offering three of its new super-fruit smoothie flavors for only a dollar! These include Pomegranate, Yumberry or Acai 16 oz smoothies - they are just awesome!
Yumberry fruit is a Chinese / Japanese Bayberry which looks like litchi except that the outer skin is also edible.
Acai fruit or Acai berry has been long touted as a very good anti-oxidant but not clinically proven as yet.

So go ahead and have a healthy fruit smoothie today for a buck, courtesy of Jamba Juice!

LinkWithin

Related Posts Plugin for WordPress, Blogger...