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 | |
$curl = curl_init('place url'); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); | |
$page = curl_exec($curl); | |
if(curl_errno($curl)) // check for execution errors | |
{ | |
echo 'Scraper error: ' . curl_error($curl); | |
exit; |
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 | |
$parentCategoryId = 107; | |
$cat = Mage::getModel('catalog/category')->load($parentCategoryId); | |
$subcats = $cat->getChildren(); | |
?> | |
// Get 1 Level sub category of Parent category. | |
<?php |
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 | |
$product = Mage::getModel('catalog/product'); | |
$attributes = Mage::getResourceModel('eav/entity_attribute_collection') | |
->setEntityTypeFilter($product->getResource()->getTypeId()) | |
->addFieldToFilter('attribute_code', 'manufacturer'); | |
$attribute = $attributes->getFirstItem()->setEntity($product->getResource()); | |
$manufacturers = $attribute->getSource()->getAllOptions(false); | |
?> | |
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 | |
if ($_product) { | |
// get collection of categories this product is associated with | |
$categories =$_product->getCategoryCollection() | |
->setPage(1, 1) | |
//->addFieldToFilter(‘level’,"3") | |
//->addFieldToFilter(‘parent_id’,"3") | |
//->setOrder("level") | |
->load(); |
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
$orderaddress = Mage::getModel('sales/order_address')->load($order->getShippingAddressId()); | |
$street_first_line = $orderaddress->getStreet(1); | |
return $street_first_line; | |
$orderaddress = Mage::getModel('sales/order_address')->load($order->getShippingAddressId()); | |
$street_second_line = $orderaddress->getStreet(2); | |
return $street_second_line; |
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
/* | |
Remove unwanted links from Account Dashboard Navigation | |
Step 1: Go To ( YourTemplate/customer/account/navigation.phtml ) | |
Step 2: Replace This Line: <?php $_count = count($_links); ?> | |
*/ | |
<?php $_count = count($_links); /* Add or Remove Account Left Navigation Links Here -*/ | |
unset($_links['account']); /* Account Info */ | |
unset($_links['account_edit']); /* Account Info */ | |
unset($_links['tags']); /* My Tags */ |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<layout> | |
<!-- ## Default Layout ## --> | |
<default> | |
<!-- Remove unwanted blocks entirely | |
<remove name="right.poll"/> | |
<remove name="right.permanent.callout"/> |
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 echo $this->getLayout()->createBlock('cms/block')->setBlockId('staticblock_identifier')->toHtml() ?> |
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
jQuery.fn.verticalAlign = function () | |
{ | |
return this | |
.css("margin-top",($(this).parent().height() - $(this).height())/2 + 'px' ) | |
}; | |
$('element').verticalAlign(); |
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
$(window).bind('resize', function(e){ | |
window.resizeEvt; | |
$(window).resize(function(){ | |
clearTimeout(window.resizeEvt); | |
window.resizeEvt = setTimeout(function(){ | |
} ,500); | |
}); | |
}); |