Clients

Usuari registrat

if(Mage::getSingleton('customer/session')->isLoggedIn()):

Grup de clients

<?php
    $roleId = Mage::getSingleton('customer/session')->getCustomerGroupId();
    $role = Mage::getSingleton('customer/group')->load($roleId)->getData('customer_group_code');
    $role = strtolower($role);
    if($role == 'internal') {
        echo 'Hello internal...';
    }
?>

O saber només el grup del client

<?php
    $roleId = Mage::getSingleton('customer/session')->getCustomerGroupId();
?>

<p>
    <?php if($roleId == 4): ?>
        PVP recomendado <?php echo $this->getPriceHtml($_product) ?>
    <?php else: ?>
        <?php echo $this->getPriceHtml($_product) ?>
    <?php endif; ?>
</p>
 
magento/customer.txt · Darrera modificació: 2010/03/24 09:50 per resteve
 
Copyright: Zikzakmedia Llicència Creative Commons By-NC-SA
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki