Friday, 18 March 2016

how to play youtube video in popup window using jquery

<script type="text/javascript" src="http://www.youtube.com/player_api"></script>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>

<span onclick="playvideo('1');player1.playVideo();" class="yt-link"><h1>Play</h1></span>
<div style="display: none;" id="pop_1" class="video-popup">
 <span onclick="closevideo('1');player1.pauseVideo();" class="closed">X</span>
 <iframe width="800" height="600" frameborder="0" allowfullscreen="true" onload="player1=new YT.Player(this)" src="http://www.youtube.com/embed/8HQIKJBUsQk?rel=0&amp;enablejsapi=1" id="if_"></iframe>
 </div>


<span onclick="playvideo('2');player2.playVideo();" class="yt-link"><h1>Play</h1></span>
<div style="display:none;" id="pop_2" class="video-popup">
 <span onclick="closevideo('2');player2.pauseVideo();" class="closed">X</span>
 <iframe width="800" height="600" frameborder="0" allowfullscreen="true" onload="player2=new YT.Player(this)" src="http://www.youtube.com/embed/X71R64AdoOo?rel=0&amp;enablejsapi=1" id="if_"></iframe>
 </div>

 <span onclick="playvideo('3');player3.playVideo();" class="yt-link"><h1>Play</h1></span>
  <div style="display:none;" id="pop_3" class="video-popup">
 <span onclick="closevideo('3');player3.pauseVideo();" class="closed">X</span>
 <iframe width="800" height="600" frameborder="0" allowfullscreen="true" onload="player3=new YT.Player(this)" src="http://www.youtube.com/embed/BOCvHWoqssI?rel=0&amp;enablejsapi=1" id="if_"></iframe>
 </div>

 <span onclick="playvideo('4');player4.playVideo();" class="yt-link"><h1>Play</h1></span>
 <div style="display:none;" id="pop_4" class="video-popup">
 <span onclick="closevideo('4');player4.pauseVideo();" class="closed">X</span>
 <iframe width="800" height="600" frameborder="0" allowfullscreen="true" onload="player4=new YT.Player(this)" src="http://www.youtube.com/embed/qBLN-sOL6eU?rel=0&amp;enablejsapi=1" id="if_"></iframe>
 </div>                     
 <script>
var noc = jQuery.noConflict();
function playvideo(ytid) {
noc("#pop_"+ytid).show();
}
function closevideo(ids) {
noc("#pop_"+ids).hide();
}
</script>

  

Thursday, 11 February 2016

Magento Add custom image attribute to category


 Just copy paste the below code in header.phtml and run your magento once, your attribute will be created and you can see in backend under manage category. After you are done remove this code again.
 
<?php
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$setup->addAttribute('catalog_category', 'sliderimage2', array(
    'group'         => 'General',
    'input'         => 'image',
    'type'          => 'varchar',
    'label'         => 'Slider Image 2',
    'backend'       => 'catalog/category_attribute_backend_image',
    'visible'       => 1,
    'required'        => 0,
    'user_defined' => 1,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
)); ?>

Tuesday, 2 February 2016

How to change the Magento Email Templates

You’ll probably know by now that the transactional email templates in Magento are a bit, with respect, “naff”. To edit through the admin will take forever and a day so here’s a couple of useful solutions to help make things easier.


Locate the email templates.
The Magento email templates are located in (note: “en_US” may change depending on language).
magento\app\locale\en_US\template\email\account_new.html”:
magento\app\locale\en_US\template\email\admin_password_new.html”:
magento\app\locale\en_US\template\email\sales\newsletter_subscr_confirm.html”:
magento\app\locale\en_US\template\email\sales\order_creditmemo.html”:
magento\app\locale\en_US\template\email\sales\order_creditmemo.html”:
magento\app\locale\en_US\template\email\sales\order_invoice.html”:
magento\app\locale\en_US\template\email\sales\order_invoice.html”:
magento\app\locale\en_US\template\email\sales\order_new.html”:
magento\app\locale\en_US\template\email\sales\order_new.html”:
magento\app\locale\en_US\template\email\sales\order_shipment.html”:
magento\app\locale\en_US\template\email\sales\order_shipment.html”:
magento\app\locale\en_US\template\email\sales\order_update.html”:
magento\app\locale\en_US\template\email\password_new.html”:
magento\app\locale\en_US\template\email\wishlist_share.html”:

Magento add CMS Static Block underneath categories in left sidebar

Paste below xml code in custom design part  for call static block after left navigation.

 <reference name="left">
<block type="cms/block" name="book_left_block" after="catalog.leftnav">
<action method="setBlockId"><block_id>book_left_block</block_id></action>
</block>
</reference>

For remove left navigation from left sidebar.
 <reference name="left">
<block type="cms/block" name="book_left_block" after="catalog.leftnav">
<action method="setBlockId"><block_id>book_left_block</block_id></action>
</block>
<remove name="catalog.leftnav" />
</reference>

Tuesday, 12 January 2016

How to remove public and index.php from URL in laravel

1.) First copy all files of public folder and paste in root directry.

2.) open the index file

set path on line no. 21 require __DIR__.'/bootstrap/autoload.php';
and line no. 35   $app = require_once __DIR__.'/bootstrap/app.php';
 
3.) Open .htaccess file and paste following code.

Options -MultiViews
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

Wednesday, 30 December 2015

order email confirmation not received in Magento 1.9.1

Just make a small change in order.php

/app/code/core/Mage/Sales/Model/Order.php

First, create one directory structure on the path below, then copy and paste the file to the path below.

/app/code/local/Mage/Sales/Model/Order.php

Now, change from

$mailer->setQueue($emailQueue)->send();

to

$mailer->send();

Tuesday, 29 December 2015

magento 2 - how to enable developer mode

Open run cmd and go to magento root directory and run below command :-

php bin/magento deploy:mode:set developer