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
//add this as the URL of your bookmark, then just click the bookmark to trigger the script when you are on an IG page with an image selected. | |
javascript:(function(){var dialog = document.querySelector('.vCf6V'); var standAlone = document.querySelector('._97aPb'); if(!dialog && standAlone){ dialog = standAlone; } if(!dialog && !standAlone){ alert('Please open a IG image to scrape it.'); } else { dialog.querySelectorAll('.FFVAD').forEach(function(e){ var list = e.srcset.split(',').reverse(); list.forEach(function(source){ var sizeimg = source.split(' '); prompt('The image size is:'+sizeimg[1],sizeimg[0]) }) }) }})(); | |
//alternative; opens largest image in new tab automatically | |
javascript:(function(){var dialog = document.querySelector('.vCf6V'); var standAlone = document.querySelector('._97aPb'); if(!dialog && standAlone){ dialog = standAlone; } if(!dialog && !standAlone){ alert('Please open a IG image to scrape it.'); } else { dialog.querySelectorAll('.FFVAD').forEach(function(e){ var list = e.srcset.split(',' |
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
/* Best Sellers Category */ | |
$today = time(); | |
$from = date('Y-m-d', strtotime("-12 months",$today));//pull best sellers from 12 months prior order data | |
$to = date("Y-m-d", $today); | |
$resource = Mage::getSingleton('core/resource'); | |
$readConnection = $resource->getConnection('core_read'); | |
$orderTableAliasName = $readConnection->quoteIdentifier('order'); |
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 editQty = (function(){ | |
function editValue(e) { | |
var input = e.target.nextElementSibling || e.target.previousElementSibling; | |
input.value = counter(e.target.classList.contains('plus'),input.value); | |
} | |
function counter(add,x) { | |
return add ? ++x : (x > 1 ? --x : x); | |
} |
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
filepath: app/etc/modules/ | |
<?xml version="1.0"?> | |
<config> | |
<modules> | |
<My_Module> | |
<active>true</active> | |
<codePool>local</codePool> | |
</My_Module> | |
</modules> | |
</config> |
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
$custom_option1 = array('label'=>'Custom1','value'=>$value1); | |
$custom_option2 = array('label'=>'Custom2','value'=>$value2); | |
$product->addCustomOption('additional_options', serialize(array($custom_option1,$custom_option2))); | |
$product->setHasOptions(true); | |
$cart->addProduct($product, $params); | |
$cart->save(); | |
//USE 'additional_options' if you need the CustomOption to show up on checkout/cart, as $item->getCustomOptions() only looks at 'additional_options' and 'option_ids' | |
$item->getOptionByCode('option_ids'); |
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
default | |
catalog_category_default (* also used in directory.xml) | |
catalog_category_layered (* also used in directory.xml) | |
catalog_product_compare_index | |
catalog_product_gallery | |
catalog_product_send | |
catalog_product_view (* also used in customeralert.xml, tag.xml) | |
catalog_seo_searchterm_popular | |
catalog_seo_sitemap_category | |
catalog_seo_sitemap_product |
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
FILE PATH: app/code/core/Mage/Core/Model/Session/Abstract/Varien.php | |
// session cookie params | |
$cookieParams = array( | |
'lifetime' => $cookie->getLifetime(), | |
'path' => $cookie->getPath(), | |
- 'domain' => $cookie->getConfigDomain(), | |
+ 'domain' => $cookie->getDomain(), | |
'secure' => $cookie->isSecure(), | |
'httponly' => $cookie->getHttponly() | |
); |
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
//ADD THIS TO END OF YOUR JQUERY FILE OR RUN IT AFTER JQUERY IS LOADED | |
// Prototype.js loads -> then jquery.js loads -> then run this | |
//alternatively, upgrade and load jquery 3 first then prototype.js and you shouldn't need this fix. | |
if(Prototype.BrowserFeatures.ElementExtensions){var disablePrototypeJS=function(o,e){var t=function(e){e.target[o]=void 0,setTimeout(function(){delete e.target[o]},0)};e.each(function(e){jQuery(window).on(o+".bs."+e,t)})},pluginsToDisable=["collapse","dropdown","modal","tooltip","popover"];disablePrototypeJS("show",pluginsToDisable),disablePrototypeJS("hide",pluginsToDisable)} |
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 Layout Handles Used | |
var_dump(Mage::app()->getLayout()->getUpdate()->getHandles()); | |
//Get loaded layout blocks | |
var_dump(array_keys(Mage::app()->getLayout()->getAllBlocks())); | |
//Add to Global Messages | |
Mage::getSingleton('core/session')->addSuccess('Success Message'); | |
Mage::getSingleton('core/session')->addError('Error Message'); | |
Mage::getSingleton('core/session')->addWarning('Warning Message'); |
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 | |
public function getProductCollection(){ | |
if($_category = Mage::registry('current_category')){ | |
$_categoryId = $_category->getId(); | |
$_productCollection = Mage::getResourceModel('catalog/product_collection'); | |
$_productCollection->joinTable(array('cp'=>'catalog/category_product'), 'product_id=entity_id', array('*') ,'cp.category_id='.$_categoryId, 'inner'); //join the table we need, filtered on Category ID | |
$_productCollection | |
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes()) //attributes needed from products using default config, or select your own | |
->addAttributeToFilter('status', 1) //ensure its enabled |
NewerOlder