This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// If you want to call static block in page | |
// Try below code : | |
{{block class="Magento\\Cms\\Block\\Block" block_id="block_identifier"}} | |
?> | |
<?php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<textarea name="editor"></textarea> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* contains custom token declaration script. | |
*/ | |
/** | |
* Implements hook_token_info(). | |
*/ | |
function custom_token_info(){ | |
$types['custom_type'] = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Below function will return a object of query string variable | |
**/ | |
var QueryString = function () { | |
// This function is anonymous, is executed immediately and | |
// the return value is assigned to QueryString! | |
var query_string = {}; | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
for (var i=0;i<vars.length;i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_ip() { | |
//Just get the headers if we can or else use the SERVER global | |
if ( function_exists( 'apache_request_headers' ) ) { | |
$headers = apache_request_headers(); | |
} else { | |
$headers = $_SERVER; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$hooks = array( | |
"template_fetch_template" => "template_fetch_template", | |
"store_order_item_add_start" => "store_order_item_add_start" | |
); | |
foreach ($hooks as $hook => $method){ | |
$data = array( | |
'class' => __CLASS__, | |
'method' => $hook, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.unique = function() { | |
var a = this.concat(); | |
for(var i=0; i<a.length; ++i) { | |
for(var j=i+1; j<a.length; ++j) { | |
if(a[i] === a[j]) | |
a.splice(j--, 1); | |
} | |
} | |
return a; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
EXAMPLE ARRAY:- | |
array( | |
[field_ft_channel_id] => value of field | |
[field_ft_status] => value of field | |
[field_ft_author_id] => value of field | |
[field_id_14] => value of field | |
[field_id_15] => value of field | |
[field_id_16] => value of field|value of field |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* HOW TO:- | |
* Here is simple accessories code for adding ckeditor / wysiwyg editor in category description field in expression engine. | |
* create a directory as /system/expressionengine/third_party/eme_utills | |
* create a accessories addon file like /system/expressionengine/third_party/eme_utills/acc.eme_utills.php | |
* Now add the following code to it | |
*/ | |
/** | |
* EME UTILLS Accessory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.colorbox({ | |
open: true, | |
height: 500, | |
width: 500, | |
onComplete: function() { | |
$("#colorbox").wrap("<div id='colorbox_wrapper' />") | |
}, | |
onCleanup: function() { | |
$("#colorbox").unwrap("<div id='colorbox_wrapper' />") | |
} |