by PHPMySQLTalk | Aug 28, 2012 | Magento |
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…)
by PHPMySQLTalk | Aug 28, 2012 | Magento |
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…)
by PHPMySQLTalk | Aug 28, 2012 | Scripts |
<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>
by PHPMySQLTalk | Aug 28, 2012 | PHP |
$url = 'http://www.example.com/a-large-file.zip';
$path = '/path/to/a-large-file.zip';
$fp = fopen($path, 'w');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $fp);
$data = curl_exec($ch);
curl_close($ch);
fclose($fp);
by PHPMySQLTalk | Aug 28, 2012 | Magento |
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;?>
by PHPMySQLTalk | Aug 28, 2012 | Magento |
List the categories a product belongs to
$product = Mage::getModel('catalog/product')->load($productId);
$cats = $product->getCategoryIds();
foreach ($cats as $category_id) {
$_cat = Mage::getModel('catalog/category')->load($category_id) ;
echo $_cat->getName();
}
by PHPMySQLTalk | Aug 28, 2012 | Joomla |
I found a way to solve both problems, but I don’t know if this is the right way to solve it.
I added an IF sentence in the second pass of the function “_findItem” to find the right item when there is the value ‘item’ in $needles, like this:
components/com_k2/helpers/route.php
Add this code (more…)
by PHPMySQLTalk | Aug 28, 2012 | 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;
}
by PHPMySQLTalk | Aug 28, 2012 | Magento |
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
by PHPMySQLTalk | Aug 28, 2012 | jQuery, Scripts |
<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>
Recent Comments