This file contains hidden or 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 checkUstId($ustId) { | |
| $serviceUrl = 'http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl'; | |
| $vatNumber = substr($ustId,2); | |
| $countryCode = substr($ustId,0,2); | |
| $soap = new SoapClient($serviceUrl); | |
| $result = $soap->checkVat(array("countryCode" => $countryCode, "vatNumber" => $vatNumber)); | |
This file contains hidden or 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
| if (!String.prototype.trim) { | |
| String.prototype.trim = function () { | |
| return this.replace(/^\s+|\s+$/g, ''); | |
| }; | |
| } |
This file contains hidden or 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
| // capitalize string | |
| String.prototype.cap = function(){ | |
| return this.replace( /(^|\s)([a-z])/g , function(m,p1,p2){return p1+p2.toUpperCase();}); | |
| }; |
This file contains hidden or 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
| var jq = document.createElement('script'); | |
| jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"; | |
| document.getElementsByTagName('head')[0].appendChild(jq); | |
| jQuery.noConflict(); |
This file contains hidden or 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
| $('a').each(function(){ | |
| var $this = $(this); | |
| $this.attr('href',$this.attr('href') + '?tmpl=component'); | |
| }); |
This file contains hidden or 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 | |
| // Gets the current store's details | |
| $store = Mage::app()->getStore(); | |
| // Gets the current store's id | |
| $storeId = Mage::app()->getStore()->getStoreId(); | |
| // Gets the current store's code | |
| $storeCode = Mage::app()->getStore()->getCode(); | |
This file contains hidden or 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
| var users = [ | |
| {name:'johndoe', password: 'secret', displayName: 'John Doe'}, | |
| {name:'elladoe', password: 'secret', displayName: 'Ella Doe'}, | |
| {name:'minidoe', password: 'secret', displayName: 'Mini Doe'} | |
| ]; | |
| var username = 'johndoe'; | |
| // return current user or null if not found | |
| var user = users.map(function(user){ |
This file contains hidden or 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
| // create array from NodeList without modifying NodeList Prototype | |
| var arr = Array.prototype.slice.call( document.querySelectorAll('div') ); | |
| // extend NodeList prototype... | |
| NodeList.prototype.array = function() { | |
| return Array.prototype.slice.call(this); | |
| }; | |
| // ...and use it as chained method | |
| var arr = document.querySelectorAll('div').array(); |
This file contains hidden or 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
| changes must be made here: | |
| app\design\adminhtml\default\default\template\page\header.phtml | |
| skin\adminhtml\default\THEME\images |
This file contains hidden or 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
| // get language | |
| $lang = JFactory::getLanguage()->getLocale()[4]; | |
| if ($lang === 'en') { | |
| ... | |
| } | |
| //----------------------------------------------------------------------------------- | |
| // inject it into javascript global namespace (e.g. in joomla template index.php) |
OlderNewer