문제

i'm using CMS pages and Static Blocks and would like to hide a text paragraph from showing it to a wholesale group.

is this possible with magento? Kindly help.

Magento 1.8.1

도움이 되었습니까?

해결책

If,you want to hide a text paragraph from ,then first check wholesaler is logged in or not, then check current customer group is wholesaler.

Here code add in header.phtml

<?php
    if(Mage::getSingleton('customer/session')->isLoggedIn() and Mage::getSingleton('customer/session')->getCustomerGroupId()==2 ){
    ?>
    <script type="text/javascript">
    document.getElementById("noforid").style.display=none;
    </script>
    /* using jquery*/
     <?php 
    // do not show paragraph
    //Get customer Group name
    $group = Mage::getModel('customer/group')->load($groupId);
     }
    else{
    ?>
    <?php
    // text paragraph of your
    }
    ?>

And put you content in a html element and put id of element.Using java-script hide the content.

<p id="noforid">your text</p>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top