Thursday 20 October 2011

To display the list of product from particular category if it's login.


To display the list of product from particular category  if it's login.

Check the condition of category( example :  "category id 11" ) if it's login or not...

<?php


if(Mage::registry('current_category')) {
$currentCategory = Mage::registry('current_category');
$categoryId = $currentCategory->getId();
$restrictId = 11;
           
if($categoryId == $restrictId) {
$login = Mage::getSingleton( 'customer/session' )->isLoggedIn();
$redirectUrl = Mage::getBaseUrl().'customer/account/login';
if(!$login) { ?>        
<script type="text/javascript">
this.location.href = '<?php echo $redirectUrl; ?>';
</script>
<?php 
}
}
        
}
?>

Friday 14 October 2011

Shipping configuration using price for Owebia Shipping extenstion


Shipping configuration using price for Owebia Shipping extenstion given below sample shipping rules...


#Postal
{
code: "chronopost_offert",
label: "Label",
destination: "FR",
conditions: "{cart.price_including_tax}>=1and {cart.price_including_tax}<=75",
fees:"10.00"
}


#Postal2
{
code: "chronopost_offert1",
label: "Label",
destination: "FR",
conditions: "{cart.price_including_tax}>=76and {cart.price_including_tax}<=200",
fees:"20.00"
}


#Postal3
{
code: "chronopost_offert2",
label: "Label",
destination: "FR",
conditions: "{cart.price_including_tax}>=201and {cart.price_including_tax}<=400",
fees:"30.00"
}


#Postal4
{
code: "chronopost_offert3",
label: "Label",
destination: "FR",
conditions: "{cart.price_including_tax}>=401",
fees:"0.00"
}

Friday 7 October 2011

IE9 fix for Magento


In IE9 form validation is not working perfectly so add the <meta> tag in below path

app/code/design/frontend/{package}/{theme}/template/page/html/head.phtml


<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />


Thursday 15 September 2011

When mousehover the scrolling automatic stop using JM Products Slider


Open jcarousellite_1.0.1.js in skin/frontend/default/default/joomlart/jmproductsslider/js folder


Please find line no : 253

paste this mouseover function

 $(ul).mouseover(function() {
     o.auto = 0;
     });
         $(ul).mouseout(function() {
             o.auto = 1;
     });
         
   
     and
       
Go to  function go(to) 

Find this condition

if(!running) {


Replace this below condition

 if(!running && o.auto !=0 ) {

Thursday 23 June 2011

Startup errors in Dreamweaver : The following translators were not loaded due to errors

This post is for Dreamweaver 8 version


Having followed the procedures in updating dreamweaver (as mentioned in said article), Dreamweaver did startup successfully but this time errors kept popping:

The following translators were not loaded due to errors:
ASP.htm: has configuration information that is invalid.
ASP.NET.htm: has configuration information that is invalid.
ColdFusion.htm: has configuration information that is invalid.
PHP_MySQL.htm: has configuration information that is invalid.
JSP.htm: has configuration information that is invalid.
XSLT.htm: has configuration information that is invalid.

Here is the solution


Delete FileCache.dat files from the Dreamweaver user configuration folder.
Delete the WinFileCache-7A9586CB.dat, MacFileCache-BFE7CE2E.dat, or FileCache.dat file from the Dreamweaver user configuration folder. It is recommended to delete the FileCache.dat file if you are experiencing a JavaScript error related to "dwscripts" or if you are receiving a "translators were not loaded" error message. The string of characters after "FileCache-" may differ on your machine. The location of the FileCache.dat file depends your operating system and your version of Dreamweaver. Note that on Windows, the Application Data and AppData folders are hidden by default, so verify that your Windows Explorer folder options are set to View Hidden Folders.

Dreamweaver CS3 on Windows Vista:
C:\Users\
[username]\AppData\Roaming\Adobe\Dreamweaver 9\Configuration

Dreamweaver CS3 on Windows XP:
C:\Documents and Settings\
[username]\Application Data\Adobe\Dreamweaver 9\Configuration

Dreamweaver 8 on Windows XP:
C:\Documents and Settings\
[username]\Application Data\Macromedia\Dreamweaver 8\Configuration

Dreamweaver 8 on Windows Vista:
C:\Users\
[username]\AppData\Roaming\Macromedia\Dreamweaver 8\Configuration

Dreamweaver CS3 on Macintosh:
Mac HD/Users/
[user]/Library/Application Support/Adobe/Dreamweaver 9/

Dreamweaver 8 on Macintosh:
Mac HD/Users/
[user]/Library/Application Support/Macromedia/Dreamweaver 8/

Wednesday 15 June 2011

One or more of the Cache Types are invalidated: Blocks HTML output

In Magento 1.5 displaying message to pop on every product save.

If you go to system -> Cache management -> (Invalid )option


Here is the solution  ....

Add this in your module config.xml:


<global>
<models>
<catalogrule>
    <rewrite>
        <rule>Yourpackage_Yourmodule_Model_Rule</rule>
    </rewrite>
</catalogrule>
</models>

Create file called Rule.php in YOUR module Model directory.

Add this code in newly created file:




class Yourpackage_Yourmodule_Model_Rule extends Mage_CatalogRule_Model_Rule
{
   /**
     * Apply all price rules to product
     *
     * @param int|Mage_Catalog_Model_Product $product
     * @return Mage_CatalogRule_Model_Rule
     */
    public function applyAllRulesToProduct($product)
    {
        $this->_getResource()->applyAllRulesForDateRange(NULL, NULL, $product);
        $this->_invalidateCache();
        //Notice this little line
    Mage::app()->getCacheInstance()->cleanType('block_html');
        $indexProcess = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_price');
        if ($indexProcess) {
            $indexProcess->reindexAll();
        }
    }
}


Thursday 9 June 2011

Date of Birth (DOB) Issue on registration form for Magento version 1.5.0.1

There was some error in Magento version 1.5.0.1 -

parseInt accepts a prefix to specify the radius, validation is now crippled.

I changed line 437 in /js/varien/js.js

From:


var error falseday parseInt(this.day.value) || 0month parseInt(this.month.value) || 0year parseInt(this.year.value) || 0;

Replace:

var error falseday parseInt(this.day.value10) || 0month parseInt(this.month.value10) || 0year parseInt(this.year.value10) || 0;

Friday 3 June 2011

Entity attribute option collection order

$_options = Mage::getResourceModel('eav/entity_attribute_option_collection')
  ->setStoreFilter(0)
  ->setAttributeFilter($attribute_id)
  ->setPositionOrder('asc')
  ->load();

Tuesday 17 May 2011

Magento :How to enable mod_rewrite

Log into the admin 
and navigate to system->cache management.  Click the “refresh” button next to “catalog rewrites”.