Skip to content

Instantly share code, notes, and snippets.

@arush
arush / floating div
Created August 2, 2011 07:10
Floating div based on scrollpoint
loadPCROverlay: function () {
try {
var f = ta.id("CHECK_RATE");
var h = ta.id("PERSISTENT_CHECK_RATES_CONTENT");
var d = window.getScroll();
if (!h) {
return
}
if (!f || !d) {
h.dispose();
@arush
arush / wordpress magento gigya reg
Created August 2, 2011 09:43
Wordpress Magento Gigya reg page
<!-- head -->
<!-- BEGIN Gigya Socialize -->
<!-- socialize.js script should only be included once -->
<script type="text/javascript" src="http://cdn.gigya.com/js/socialize.js?apiKey=2_T-yAvt8V45JKSmDuCaS6tYQFMpkNeIpI-AeEa8T0zC2uuPRvTANZXks5Zu0UCHXo"></script>
<script type="text/javascript">
var conf=
{
APIKey: "2_T-yAvt8V45JKSmDuCaS6tYQFMpkNeIpI-AeEa8T0zC2uuPRvTANZXks5Zu0UCHXo" ,enabledProviders: "facebook,twitter,yahoo,messenger,google,linkedin" ,connectWithoutLoginBehavior: 'alwaysLogin'
,onError:function(e) {
}
@arush
arush / price decimal modifyer
Created August 11, 2011 12:05
price decimal modifyer
// trim all decimals
public function formatPrice($price, $includeContainer = true)
{
if ($this->getCurrentCurrency()) {
return preg_replace('/.[0-9]*$/', '', $this->getCurrentCurrency()->format($price, array(), $includeContainer));
// return $this->getCurrentCurrency()->format($price, array(), $includeContainer);
}
return $price;
@arush
arush / magento curl
Created August 13, 2011 03:57
twitter curl
<?php
/**
* fly2mars-media
* http://www.fly2mars-media.de
* http://www.fly2mars-media.de/seoblog
*/
/*
* Twitter connector class
*/
class twitterConnect
@arush
arush / FB like webhook
Created August 15, 2011 16:39
FB like webook / event subscribe
window.fbAsyncInit = function () {
FB.init({
appId: 'APPID',
Status: true,
Cookie: true,
Xfbml: true
});
FB.Event.subscribe('edge.create', function (response) {
Alert("Hello World! URL Liked!");
});
@arush
arush / oneall code
Created September 8, 2011 17:42
oneall code
base > default > template > arush > oneall > scripts.phtml
<?php
if (Mage::helper('oneall')->isOneallEnabled()):
?>
<script type="text/javascript">
var oneall_js_protocol = (("https:" == document.location.protocol) ? "https" : "http");
document.write(unescape("%3Cscript src='" + oneall_js_protocol + "://evogue.api.oneall.com/socialize/library.js' type='text/javascript'%3E%3C/script%3E"));
</script>
@arush
arush / gist:1940064
Created February 29, 2012 11:11 — forked from leesbian/gist:1854374
Remove quotes that belong to anonymous users with expired cookies (because they'll never be able to retrieve them)
/**
* Clean expired quotes (cron process)
*
* @param Mage_Cron_Model_Schedule $schedule
* @return Mage_Sales_Model_Observer
*/
public function cleanExpiredQuotes($schedule)
{
Mage::dispatchEvent('clear_expired_quotes_before', array('sales_observer' => $this));
@arush
arush / ilb home mens
Created May 9, 2012 14:10
ilb home mens
{{block type="evlike/cms_like" template="evlike/likebutton.phtml" name="cms.likebutton"}}
<div class="sidepromo">
<a href="http://www.ilovebrandsoutlet.com/index.php/brands/g-star-raw.html" class="promo-item">
</a>
<a href="http://www.ilovebrandsoutlet.com/index.php/accessories/belts.html" class="promo-item bottom">
</a>
</div>
<div class="bigimage image_carousel">
<div id="foo">
<a href="/footwear.html" id="slide1"></a>
@arush
arush / ilb home ladies
Created May 9, 2012 15:30
ilb home ladies
{{block type="evlike/cms_like" template="evlike/likebutton.phtml" name="cms.likebutton"}}
<div class="sidepromo ladies">
<a href="http://www.ilovebrandsoutlet.com/index.php/brands/g-star-raw.html" class="promo-item">
</a>
<a href="http://www.ilovebrandsoutlet.com/index.php/accessories/belts.html" class="promo-item bottom">
</a>
</div>
<div class="bigimage image_carousel">
<div id="foo ladies">
<a href="/footwear.html" id="slide1"></a>