Showing posts with label E-Commerce. Show all posts
Showing posts with label E-Commerce. Show all posts

Tuesday, October 11, 2011

Entrepreneurship is the "in thing" in India


The Entrepreneurial spirit is very high in India these days with tons of very good companies and products coming jostling for attention. Many of the ideas are adaptations / localization of successful ones across other parts of the globe and some are very unique to the unique needs/demographics of the country. Here are a few that I cam across - not necessarily listed in any order of relevance or importance but more for my own future reference.

  • Revu - a twitter style instant review from via SMS
  • Paytm - instant recharge of your phone, data or tv card and get free coupons
  • freecharge.in - instant recharge of your phone, data or tv card and get free coupons
  • roopit - localized craigslist / sulekha for Bangalore only
  • mobisy - consulting to create apps for mobile platforms
  • Kreeo - platform to manage content, knowledge and social networking inside enterprises
  • CraftsVilla - online market for Indian handicrafts (on the lines of Etsy except that artisan cannot interact directly?)
  • Craftila - another online market for Indian handicrafts (on the lines of Etsy except that artisan cannot interact directly?)
  • goibibo - domestic flight, hotel, holiday & travel booking
  • kidloo - online toy store carrying all major brands
  • firstcry - online store for branded infant and baby products
  • timtara - fast growing online store
  • buyTHEprice - online electronics store
  • pluggd.in - Indian version of TechCrunch?
  • flipkart - India's very own version of Amazon?
  • mime360 - secure digital media distribution platform
  • mYusic - streaming legal bollywood music
Let me know if you see any more sites....

Tuesday, June 29, 2010

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 14, 2010

Fix Magento Error Message “Exception printing is disabled by default for security reasons”

Sometimes when Magento exceptions out, it gives the message:
“Exception printing is disabled by default for security reasons”
To remove this message, follow the steps below:

Step 1:
Copy the file errors/local.xml.sample and name it as errors/local.xml

Step 2:
Modify the configuration to suit your needs - the xml is very well commented and self-explanatory. For leaving the error log files on the server for future reference as well as email it to the store admin, the config should be setup as below:

<config>
    <skin>default</skin>
    <report>
        <!--
            "action" can be set to "print" to show exception on screen and "email"
            to send exception on specified email
        -->
        <action>email</action>
        <!--
            in "subject" you can set subject of email
        -->
        <subject>Store Debug Information</subject>
        <!--
            "email_address" admin email address
        -->
        <email_address>storeadmin@mystore.com</email_address>
        <!--
            "trash" is handle about trace info
            value "leave" is for store on disk
            value "delete" is for cleaning
        -->
        <trash>leave</trash>
    </report>
</config>

For more Magento debugging tips, check out my article Debugging Magento.

Debugging Magento

Magento some times errors out with the below message which gives no clue as to what might have gone wrong:

There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: XXXXXXXXXX

If you have access to the files on the server, then go to the folder /var/report/ and look for the file named with the above number and open it up - you will see a "stack trace" of the error!

In case you do not have access to these files, fear not! You can enable the printing of the logs on the front-end. Open the file index.php and uncomment line 71 to display the errors:

ini_set('display_errors', 1);

But remember - do not keep this on for a long time as the error messages will be visible to the world.

Friday, May 21, 2010

Import Products and Categories into Magento

Of the few shopping carts that I was playing around with, I found Zen Cart and Magento to be the best. Simplicity of the Zen Cart was very alluring and Magento was attractive for its features based on the solid framework.

However, for a new store, importing all the products and categories for the initial setup is a major area for complaint. I wonder, how such a simple and important features gets left out of such a thought out & planned product?!

The developer community has provided plug-ins for Zen Cart and Magento Extensions to solve this problem to some extent. However I still feel that the ones available for free are not so well integrated and do not provide a very clean solution. A better integrated & cleaner solution should come in pre-packaged with the cart.

The solution should take care of and provide the following features:
  • Import Category hierarchies
  • Import Product Images & gallery if required
  • Associating of Related, Cross Sell & Up Sell products

*** Sighhh **** well, so much for wishes - for now, use what you get to be as close to the end goal as possible and mash-up the required functionality with it.

LinkWithin

Related Posts Plugin for WordPress, Blogger...