Skip to content

Instantly share code, notes, and snippets.

View srinathweb's full-sized avatar

srinath madusanka srinathweb

View GitHub Profile
@srinathweb
srinathweb / magento extension folder path
Created August 20, 2015 05:19
magento extension folder path
ypically in [MagentoFolder]/app/code/community/[SomeCompanyName]/[SomePackageName]
(otherwise, instead of "community" it could be "local").
For the location of Magento itself on your server, that depends on where you installed it! :)
@srinathweb
srinathweb / magento color switch
Last active August 29, 2015 14:27
magento color switch
https://www.bemaged.com/en/blog/use-magento-swatches-in-custom-theme/
http://magento.stackexchange.com/questions/45948/how-to-use-magento-1-9-1-0-configurable-swatches-in-default-package-theme-or-a
@srinathweb
srinathweb / use for development product attributr
Created August 21, 2015 04:18
use for development product attributr
http://fredibach.ch/jquery-plugins/tabselect.php
@srinathweb
srinathweb / use for creating color swichers
Created August 25, 2015 05:06
use for creating color swichers
http://stackoverflow.com/questions/16352864/how-to-display-image-in-place-of-checkbox
http://jsfiddle.net/pKM3x/
@srinathweb
srinathweb / magento quering
Created August 28, 2015 11:30
magento quering
http://fishpig.co.uk/magento/tutorials/direct-sql-queries/
Yes you can run direct sql queries within Magento, the best way to do this is to use the read write resource. You can insatiate it with:
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$writeConnection = $resource->getConnection('core_write');
To run a select you can do something like this:
@srinathweb
srinathweb / most important magento
Created August 31, 2015 04:51
most important magento
http://www.opensourceforwebtechnologies.com/category/magento-theme/
http://www.opensourceforwebtechnologies.com/category/magento-theme/
UTF8 w/o BOM
@srinathweb
srinathweb / format number javascript
Created September 15, 2015 07:39
format number javascript
Works on all browsers, this is all you need.
function commaSeparateNumber(val){
while (/(\d+)(\d{3})/.test(val.toString())){
val = val.toString().replace(/(\d+)(\d{3})/, '$1'+','+'$2');
}
return val;
}
@srinathweb
srinathweb / refresh
Created September 17, 2015 06:34
refresh page
$.ajax({
url: "",
context: document.body,
success: function(s,x){
$(this).html(s);
}
});
@srinathweb
srinathweb / responsive background
Created September 28, 2015 09:03
responsive background
background-image:url('../images/bg.png');
background-repeat:no-repeat;
background-size:contain;
background-position:center;