Posts

why Images are not Showing on Frontend as well as Backend on Godaddy Server in magento?

Images are not Showing on Frontend as well as Backend on Godaddy Server in magento recent i transfer my project one to another server every thing is working fine on my local server but when i upload this project on another server images are not showing on frontend and  backend of products. I surfed many magento help sites with many of the suggestions and tried everything but that that was not working for me and finally after a lot of hectic trials i got the solution for it. Just Rename your .htaccess file inside the /media directory to .htaccess-old. This will absolutely work for your site. if its works for you don't forget to say thanks to this blog :)

How to add custom design twitter feed in php website?

If you are looking for twitter feed which you can customized your self then Simple copy and paste this code in your page for twitter feed and change the twitter username <?php     $username = "xyz"; // change the username     $limit = 5;     $feed = 'https://api.twitter.com/1/statuses/user_timeline.rss?screen_name='.$username.'&count='.$limit;     $tweets = file_get_contents($feed);   $tweets = str_replace("&", "&", $tweets); $tweets = str_replace("<", "<", $tweets); $tweets = str_replace(">", ">", $tweets); $tweet = explode("<item>", $tweets);     $tcount = count($tweet) - 1; for ($i = 1; $i <= $tcount; $i++) {     $endtweet = explode("</item>", $tweet[$i]);     $title = explode("<title>", $endtweet[0]);     $content = explode("</title>", $title[1]); $content[0] = str_replac

How to add a text counter in textarea or Setting a maxlength on a textarea?

if you want to add text counter your textarea and set the Setting a maxlength on a textarea. so simply add this code in file and run the file in your browser <form name="textcount" id="textcount"> <textarea cols="60"  rows="12" class="input_compose_textarea" id="description" name="description" onkeypress="textCounter(this,this.form.counter,500);" onblur="textCounter(this,this.form.counter,500);"></textarea> <br/> Max length - <input    type="text" readonly="readonly"    name="counter"    maxlength="3"    size="3"    value="500"    onblur="textCounter(this.form.counter,this,500);"> char remaining. </form> <script type="application/javascript"> function textCounter( field, countfield, maxlimit ) { if ( field.value.length > maxlimit ) { field.value = field.va

How to Check if current page is Homepage or not in magento?

Simply add this code in your page this code will check if current page is Homepage or not in magento. <?php if($this->getUrl('') == $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true))): echo "yes homepage of magento"; else: echo "this is not Homepage"; endif; ?>

How to remove right column from product details page in magento?

go to this directory app/design/frontend/base/default/layout/ open catalog.xml and search  <label>Catalog Product View (Any)</label> you can find this line around 180 line of this page code will be like this <catalog_product_view translate="label">         <label>Catalog Product View (Any)</label>         <!-- Mage_Catalog -->         <reference name="root">             <action method="setTemplate"><template>page/2columns-right.phtml</template></action>         </reference> change 2columns-right.phtml to 1column.phtml  <catalog_product_view translate="label">         <label>Catalog Product View (Any)</label>         <!-- Mage_Catalog -->         <reference name="root">             <action method="setTemplate"><template>page/1column.phtml</template></action>         </reference&

How to get the path of downloadable product's file of associated product or group product which was upload during add downloadable product?

How to get the path of  downloadable product's file of associated product or group product which was upload during add downloadable product? This will return you full path of downloadable product  $file =''; $home_url = Mage::helper('core/url')->getHomeUrl(); $static_path = $home_url."media/downloadable/files/links"; $productLinks = $ $product ->getTypeInstance(true)->getLinks($product); foreach($productLinks as $key=>$val) {       $val = trim($productLinks[$key]->link_file);         if($val!='')         {         $file = $val;         }         else         {         $file = '';         } } echo $file_path = $static_path.$file;

HOW TO GET GET BASE URL, SKIN URL, GET MEDIA URL, GET STORE URL AND OTHER URLS IN MAGENTO?

HOW TO GET  GET BASE URL, SKIN URL, GET MEDIA URL, GET STORE URL AND OTHER URLS IN MAGENTO? HERE IS SOME USEFULL URL FOR YOU WHICH CAN HELP YOU TO USE THE DEFINE URL IN MAGENTO HOPE THIS WILL HELP YOU. To get Media URL {{media url='/sampleimage.jpg'}} To get Store URL {{store url='mypage.html'}} To get Base URL {{base url='yourstore/mypage.html'}} TO Retrieve URL path in PHTML Note: In editing PHTML don't forget to enclode the following code with PHP tag Not secure Skin URL: <?php echo $this->getSkinUrl('images/sampleimage.jpg') ?> Secure Skin URL <?php echo $this->getSkinUrl('images/ sampleimage.gif', array('_secure'=>true)) ?> Get  Current URL $current_url = Mage::helper('core/url')->getCurrentUrl(); Get Home URL $home_url = Mage::helper('core/url')->getHomeUrl(); Get Magento Media Url Mage::getBaseUrl(