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