Monday, 21 November 2016

How can import jafarkhanphp.blogspot.com data in wordpress

You can back up your blog content and import it to wordpress blog. You can also back up your.
  1. Firstly Login in to Blogger.
  2. Click Left hand Site “Setting Menu”
  3. Then Click Other Option
  4. See Import & back up Option and click “Backup Content”
  5. In the “Import & back up” section, click Back up ContentSave to your computer.
  6. And Again Login wordpress blog login
  7. Go to Tools-àimportàClick Blogger
  8. Then Browse Downloaded Blog xml File and import
  9. The you see all BlogSpot data imported in wordpress blog

Monday, 17 October 2016

Magento connect manager redirects to homepage

I have also facing the issue of when I click on Magento Connect Manager it redirects to the homepage of my site.

Downloaded magento and reinstalled downloader to my store root directory 
- Deleted my var/cache and var/sessions
- Deleted connect.cfg and cache.cfg from downloader folder

Refresh site and again connect magento connect manager.

If your problem solve please comment me.

thanks   

Monday, 4 January 2016

Order confirmation and invoice emails are not being sent in magento 1.7



Go to System > Configuration > ADVANCED > System > Mail Sending Settings
Disable Email Communications = No
Host = I changed it from localhost to mail.mydomain.com
Port (25) = 25
Set Return-Path = No
Now, all email from Magento is normally sent.

Wednesday, 14 October 2015

Unable to apply Rules in magento

Store has thousands of Products and Catalog Price Rules. The rules weren't being applied, and after debugging cron and other things that have been a problem in the past, I took a look at the catalogrule_product_price table to see what was there. I saw a single entry:

Notice the value for rule_product_price_id -- Indeed, the max value for an INT(10) field. Reset your auto-increment and you should be good.

you change data type int(10) to bigint(15)

Wednesday, 19 November 2014

How to call Related product in static Block in Magento


How to call Related product in static Block in Magento


1. Login in admin panel 
2. CMC->> statick Blog
3. Paste Code whose blog wheer you display related product 
{{block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"}}

Tuesday, 2 September 2014

Learn how to remove the Newsletter



Learn how to remove the Newsletter from Magento

In this tutorial we will show you how to remove some of the default blocks from your site using only the Magento admin panel.

With the help of the panel you can remove the Newsletter blocks from your Magento site.

To remove the Newsletter  in to your Magento admin panel, go to System > Configuration, from the Advanced menu in the bottom left corner of the screen click on the Advanced tab, set Mage_Newsletter to Disable, and press the Save Config button:

Monday, 21 July 2014

How to Remove WordPress Logo and menu From Admin Bar

Using the code below will remove the WordPress logo and wordpress Related sub menu from the Admin top Bar. The only thing you need to do is paste this code into the wp-content/thems/yourthems/function.php file of your theme.


add_action('admin_bar_menu', 'remove_wp_logo', 999);
function remove_wp_logo( $wp_admin_bar ) {
$wp_admin_bar->remove_node('wp-logo');
}

Sunday, 6 July 2014

How To Add Product Images In Magento Order details Pages in Backend

Find Out

app/design/adminhtml/default/default/template/sales/order/view/items.phtml
Suppose we want to add product images then we have to add with an extra table head with the current haead
<th><?php echo $this->helper('sales')->__('Images') ?></th> // line No 39

And Next Step 


Again find out
app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml

<td>
   <?php
    $obj = Mage::getModel('catalog/product');
     
    $_product = $obj->load($_item->getProductId());?>
    <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(150); ?>" alt="images" />
</td>

Thursday, 1 May 2014

Add Magento contact form to any CMS page as a static block

Add the Magento contact form to a CMS page as a static block


Magento has a built-in contact form . You may for example want to add your company address, contact details or even a Google Map. This can quite easily be done by creating a CMS page and including the contact form portion of the standard Magento contact form as a static block.
To achieve this, do the following:
1. Create your CMS page (Admin > Manage Pages)
2. Paste the following HTML where you would like the contact form to be positioned in your CMS page:
{{block type="core/template" name="contactForm" 
form_action="/contacts/index/post" template="contacts/form.phtml"}}

Wednesday, 30 April 2014

Adding a Static Block to a CMS Page in Magento Ecommercer

Magento: Adding a Static Block to a CMS Page


1) Create a static block


Login to your Magento control panel and go to CMS > Static Blocks > Add New Block

Give the block a title, identifier, switch it to enabled and add some content. Once complete hit the ‘Save Block’ button

2) Reference the static block in a CMS page


This is the final step, go to CMS > Pages and either create a new page or add the block to a pre-existing one of your choosing.

Once the editor window has loaded just add this piece of code to your desired location:

{{block type="cms/block" block_id="buyshop_contacts_in_footer"}}

1) Create a static block

Login to your Magento control panel and go to CMS > Static Blocks > Add New Block
Give the block a title, identifier, switch it to enabled and add some content. Once complete hit the ‘Save Block’ button

2) Reference the static block in a CMS page

This is the final step, go to CMS > Pages and either create a new page or add the block to a pre-existing one of your choosing.
Once the editor window has loaded just add this piece of code to your desired location:
- See more at: http://www.sjlwebdesign.co.uk/sjl-blog/index.php/web-design/magento/magento-adding-a-static-block-to-a-cms-page/#sthash.WEv9fvg4.dpuf1) Create a static block

Login to your Magento control panel and go to CMS > Static Blocks > Add New Block

Give the block a title, identifier, switch it to enabled and add some content. Once complete hit the ‘Save Block’ button
2) Reference the static block in a CMS page

This is the final step, go to CMS > Pages and either create a new page or add the block to a pre-existing one of your choosing.

Once the editor window has loaded just add this piece of code to your desired location:

Saturday, 5 April 2014

Product Custom options dropdown list width problem in magento

Client Problem

Client just added a custom option to my product called color. This is a drop down field and can have a list of values. The problem is that the width of this drop down now takes over the whole screen and I cannot for the life of me find where I can decrease the width.

If you haven’t already done so you will probably want to change the product options display to “Product Info Column” (go to this option Product > Design > Display product options in > Product Info Column)

That will reduce the size and change the position of the product options. If you need to reduce it more then from what firebug shows you need to edit the width of .product-info-box in skin/adminhtml/default/default/boxes.css - this also affects all information above it so make sure you don’t make it too small or it’ll screw up the look of the page. To reduce the size of the dropdown boxes but keep the product option container the same size you need to play around with the .product-options css in boxes.css

Saturday, 22 March 2014

How to change ZIP/Postcode to Post code label from the checkout page in Magento



At the billing address and shipping address steps of the checkout process in Magento the label for zip/postcode to change Post code. If you want to change, you have to make a few code modifications.


You need to go to public_html/app/design/frontend/base/default/template/checkout/onepage/billing.phtml. This path is to the billing.phtml file of the default theme that comes prepackaged with Magento; if you use another theme you may need to edit the file of that theme. In the billing.phtml file find and comment out the following code (around line 105):
 

<div class="field">
<label for="billing:postcode" class="required"><em>*</em>
<?php echo $this->__('Zip/Postal Code') ?></label>
<div class="input-box">
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" 
name="billing[postcode]" id="billing:postcode" 
value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" 
class="input-text validate-zip-international <?php echo $this->
helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
</div>
</div>
 
 
After that edit the file  
public_html/app/design/frontend/base/default/template/checkout/onepage/
shipping.phtml 
and comment out the code (around line 96): 

<div class="field">
<label for="shipping:postcode" class="required"><em>*</em>
<?php echo $this->__('Zip/Postal Code') ?></label>
<div class="input-box">
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" 
name="shipping[postcode]" id="shipping:postcode" 
value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" 
class="input-text validate-zip-international 
<?php echo $this->helper('customer/address')->
getAttributeValidationClass('postcode') ?
>" onchange="shipping.setSameAsBilling(false);" />
</div>
</div>
 
You need to edit another billing.phtml file but in a different location. 
With public_html being the root Magento directory on your hosting account and 
with the default theme, the path to the file will be 
public_html/app/design/frontend/base/default/template/persistent/checkout/
onepage/billing.phtml
In that file find and comment out the code (around line 106): 
 

<div class="field">
<label for="billing:postcode" class="required"><em>*</em>
<?php echo $this->__('Zip/Postal Code') ?></label>
<div class="input-box">
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" 
name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml
($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international 
<?php echo $this->helper('customer/address')->
getAttributeValidationClass('postcode') ?>" />
</div>
</div>

Wednesday, 19 March 2014

Simplest way to use uploadify with cakephp

I have posted a tutorial on how to use uploadify with cakephp

Users can upload images with uploadify and when uploadify sends the image to my controller I simply attach the sessionid as a parameter.

Step One.
Create function on own controller 
app/controller/PagesController.php

public function index() { /* this function for show index page*/
    $this->layout='home';
        $this->set('title_for_layout', 'Photo Upload');
      
    }
   
    public function uploadify() { /* this function for upload file */
    $this->autoRender=false;
   
         $targetFolder = WWW_ROOT .'/img/';  // this folder created on webroot/
      
         $tempFile = $_FILES['Filedata']['tmp_name'];
       $targetPath = $targetFolder;
    $targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
   
    // Validate the file type
    $fileTypes = array('jpg','jpeg','gif','png'); // File extensions
    $fileParts = pathinfo($_FILES['Filedata']['name']);
   
    if (in_array($fileParts['extension'],$fileTypes)) {
        move_uploaded_file($tempFile,$targetFile);
        echo $_FILES['Filedata']['name'];
    } else {
        echo 'Invalid file type.';
    }
      
    }

Step 2
create view file for display 
<h1>Uploadify Demo</h1>
     <?php echo $this->Form->create('Setting', array('url'=>'#','type' => 'file')); ?>
        <div id="queue"></div>
      <?php echo $this->Form->input('file_upload',array('type' => 'file', "id"=>'file_upload', 'div'=>false,'label'=>false,"multiple"=>"true"));?>
<?php echo $this->Form->input('police_no',array('id'=>'police_no', 'div'=>false,'label'=>false));?>
<?php echo $this->Form->button('Submit',array('class'=>'button','div'=>false,'label'=>false));?>
    <script type="text/javascript">
        <?php $timestamp = 'phptp';?>
        $(function() {
            $('#file_upload').uploadify({
                'formData'     : {
                    'test' : '<?php 'photoupload';?>',
                    'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'
                },
                'method'   : 'post',
                 'fileSizeLimit' : '100KB',
                 'fileTypeDesc' : 'Image Files',
                'fileTypeExts' : '*.gif; *.jpg; *.png',
                'debug'    : false,
                'swf'      : '../img/uploadify.swf', /* this file save into webroot/images folder*/
                'uploader' : '../Pages/uploadify', /* this function will come for controller
                'onUploadSuccess' : function(file, data, response) {
                 document.getElementById('police_no').value=data;


        }
            });
        });

Saturday, 15 February 2014

How to fix application/x-httpd-php in magento


0
Share

How to resolve this issue when .php couldn't execute by your server?

  1. Open your .htaccess file and take its backup
  2. Delete the old .htaccess file
  3. Create a new .htaccess file with CHMOD = 777 and upload the new file in ascii mode.
  4. Add the following handler in the blank .htaccess
AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php .php .htm .html
Or coment this code just like given below  
#AddHandler application/x-httpd-php54s .php
 

 

Tuesday, 22 October 2013

Add search to your site

 Add search to your site

 Once you've created your custom search engine, you can add the Custom Search element to your site so that visitors can use it. To do this, you'll need to copy some code and paste it into your site's HTML where you want your search engine to appear.

<form method="get" action="GoogleSearch.htm" target="_top">
    <table border="0" align="right" cellpadding="0" cellspacing="0">
        <tr>
            <td height="38" align="left" valign="top" nowrap="nowrap">
                <input type="text" name="q" size="31" maxlength="200" value="" id="input1" class="inputboxgoogle" />
            </td>
            <td align="left" valign="top" nowrap="nowrap">
                <input name="sa" type="image" src="images/Logo_25blk.gif" alt="Google" id="input2" />
                <input type="hidden" name="client" value="pub-9919055307302416" />
                <input type="hidden" name="forid" value="1" />
                <input type="hidden" name="ie" value="ISO-8859-1" />
                <input type="hidden" name="oe" value="ISO-8859-1" />
                <input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:11" />
                <input type="hidden" name="hl" value="en" />
            </td>
        </tr>
    </table>
    </form>
    <!-- Google Search Result Snippet Begins -->
    <div id="googleSearchUnitIframe">
    </div>
    <script type="text/javascript">
        var googleSearchIframeName = 'googleSearchUnitIframe';
        var googleSearchFrameWidth = 765;
        var googleSearchFrameborder = 0;
        var googleSearchDomain = 'www.google.co.in';
    </script>
    <script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js">  </script>

Monday, 16 September 2013

How can direct import controller function in ctp file.


 How can direct import controller function in ctp file.

 Some Time we need to direct  import controller function in ctp file then given below function is very use full.

You can try it 
Firstly create method on controller file
$this->requestAction('/ControllerName/MethodName/);

Tuesday, 25 December 2012

Hiding unnecessary menus in wordpress admin


In this post, I describe a technique for hiding unnecessary menus. 



Some time we need to hind unnecessary menus for other clients role just like (administrator, contributor, subscriber, author, editor, etc) then with the help of this function we can hide wordpress menu.
1.    
1   This code include your themes>>functions.php files.

// remove unnecessary menus
function remove_admin_menus () {
                global $menu;
                                $restrict = explode(',', 'contributor');// you can pass user role (administrator, contributor, subscriber, author, editor, etc)
                $restrict_user = explode(',', 'Posts,Comments,Media,Profile,Appearance,Plugins,Users, Tools,Settings');// you can pass menus name whose you want to hide.
               
                $f = create_function('$v,$i', 'return __($v);');
                array_walk($restrict, $f);
                if (!current_user_can('activate_plugins')) {
                                array_walk($restrict_user, $f);
                                $restrict = array_merge($restrict, $restrict_user);
                }
                // remove menus
                end($menu);
                while (prev($menu)) {
                                $k = key($menu);
                                $v = explode(' ', $menu[$k][0]);
                                if(in_array(is_null($v[0]) ? '' : $v[0] , $restrict)) unset($menu[$k]);
                }
}
add_action('admin_menu', 'remove_admin_menus');

Thursday, 13 December 2012

How to remove last character of a string(mysql Query fields)?




SELECT Concat( mid( fieldname, 1, length(fieldname) -1 )
 , REPLACE( mid(fieldname, length(fieldname) ) , ',', "" ) )
 as fieldname FROM tablename
 
OR

Select id, REPLACE(fieldname,',','') from tablename 
where fieldname REGEXP '(.*),' limit 5;

update last character from string mysql

UPDATE tablename SET fieldname = Concat( mid(fieldname,
 1, length(fieldname) -1 ) , REPLACE( mid(fieldname, 
length(fieldname) ) , ',', "" ) ) 

Wednesday, 21 November 2012

After logout browser back button shows all visited page in cake php

Some time we logout from application, then we got successfully massage you are logout , but we click back button then we see we reach also last page where we logout.

I solve this problem with given below function.


Add below code in your AppController.php

 
 

public function beforeRender() {
    $this->disableCache();
   
}

Monday, 1 October 2012

Translate date into your language

 i got a requirment wherein i user add date in US(English) format but user want to display spanish language/or Other Language.

First Method :


/* Windows con apache
setlocale(LC_TIME, 'Spanish'); */

/* Apache con linux */
/* setlocale(LC_TIME, 'es_ES'); */

// setlocale(LC_TIME, 'de_DE'); 
// echo strftime('%A, %d. %B %Y');  

/* setlocale(LC_TIME, 'es_MX'); */

setlocale(LC_TIME, 'es_ES'); //pase language code 
echo $fecha=strftime('%B %d %Y',strtotime('01-09-2012'));// Output septiembre 01 2012

Second Method 

function converttospanish($paramdate)
{
$str=$paramdate;
$month = array("","enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiempre", "diciembre");// you can change different language 
if (($timestamp = strtotime($str)) !== false)
{
$php_date = getdate($timestamp);
$dm = date_parse_from_format("Y-m-d", $paramdate);
echo $php_date["mday"].' '.$month[$dm["month"]].' '.$php_date["year"];
}
else
{
echo 'invalid timestamp!';
}
}