Magento: How to remove discount coupon code?

Magento offers a built in coupon code feature to provide shopping cart customers with discounts when shopping on their ecommerce website. You can post discount codes in emails, blogs and social networks to generate more traffic and entice paying customers to your ecommerce website. But often, website owners don’t want to offer discount codes on their shopping cart. Fortunately for ecommerce web designers, it is quite easy to disable the discount coupon code function on a Magento shopping cart website.
(more…)

Magento: How to remove Estimate Shipping and Tax?

Magento offers a built in Estimate Shipping and Tax feature to provide shopping cart customers with realtime feedback of tax and shipping estimation when shopping on an ecommerce website. But often, website owners don’t want to display the Estimate Shipping and Tax function on their shopping cart website. For example, some shopping cart website owners will offer free shipping or flat rate shipping, which makes shipping estimation irrelevant, not to mention confusing and distracting to ecommerce customers. Fortunately for ecommerce web designers, it is quite easy to disable the Estimate Shipping and Tax function on a Magento shopping cart website.
(more…)

JavaScript: How to change text value in an input box?

<form name='yourForm' action="">
     <input type='text' name='yourinput' id='yourinput' value='Hello World'>
</form>

<script type="text/javascript"> 
// Assign the value to the input with the id passed in 
function replaceInputValue( idRef, val ) { 
	// Make sure browser supports getElementById  
	if(!document.getElementById ) return; 
	// Find the input by it's id 
	var inputObj = document.getElementById( idRef ); 
	if( inputObj ) { 
	// Update the value 
	inputObj.value = val; 
	}
}
replaceInputValue( 'yourinput', 'Hello Dolly' );
</script>

Magento: How to dynamically get product image URL and page title on Facebook when sharing a product?

Add thew following code just before the tag

 <?php if (Mage::registry('current_product')) : ?>
<meta property="og:image" content="<?php echo Mage::helper('catalog/image')->init(Mage::registry('current_product'), 'small_image')->resize(100,100);?>" />
<meta property="og:title" content="<?php echo Mage::registry('current_product')->getName();?>" /> 
<?php endif;?>

Magento: How to get all Store Ids, codes, names & current url in Magento?

$allStores = Mage::app()->getStores();
foreach ($allStores as $_eachStoreId => $val)
{
$_storeCode = Mage::app()->getStore($_eachStoreId)->getCode();
$_storeName = Mage::app()->getStore($_eachStoreId)->getName();
$_storeId = Mage::app()->getStore($_eachStoreId)->getId();
$_currentUrl = Mage::app()->getStore($_eachStoreId)->getCurrentUrl();
echo $_storeId;
echo $_storeCode;
echo $_storeName;
echo $_currentUrl;
}

Magento: How to remove from_store from URLs

If you look into /app/code/core/Mage/Core/Model/Store.php you see following function:

 public function getCurrentUrl($fromStore = true) 

So without changing any core code grab /app/design/frontend/base/default/template/page/switch/languages.phtml
Change the line

<option value="<?php echo $_lang->getCurrentUrl() ?>"<?php echo $_selected ?>><?php echo $this->htmlEscape($_lang->getName()) ?></option>

to

 <option value="<?php echo $_lang->getCurrentUrl(false) ?>"<?php echo $_selected ?>><?php echo $this->htmlEscape($_lang->getName()) ?></option> 

Source:
http://www.magentocommerce.com/boards/viewthread/75111/#t236739

jQuery: Even and odd classes for series of divs

<html>
	<head>
		<style>
			.odd {
				height: 5px;
				background: #960;
			}
			.even {
				height: 5px;
				background: #09C;
			}
		</style>
		<script src="js/jquery-1.7.1.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				$('div:odd').addClass('odd');
				$('div:even').addClass('even');
			})
		</script>
	</head>
	<body>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
	</body>
<html>
Page 7 of 24«45678910»

Pin It on Pinterest