cancel
Showing results for 
Search instead for 
Did you mean: 

Litemage cache issue

Litemage cache issue

Hello, I installed litemage cache extension after that I created a block like this:

 echo $this->getLayout()->createBlock('core/template','wishlistGroup')->setProduct($_product)->setTemplate('wishlist/wishlistGroup.phtml')->toHtml();

I want do not cache this block, because of this I addes below codes in config.xml of litemage extension:

 <wishlistGroup>
                    <access>private</access>
                    <blocks> wishlistGroup</blocks>
                    <ttl>0</ttl>
                </wishlistGroup>

But this is not work and after login, page is white and do not showing nothing,how can I fix this problem?

These codes are my wishlistGroup.phtml file:

<?php
    $_product=$this->getProduct();
    $use_group_wishlist_form=0;

    if(Mage::getSingleton('customer/session')->isLoggedIn()) {
        $customerData = Mage::getSingleton('customer/session')->getCustomer();
    ?>

    <div style="display: none;" class="om-addto-wishlist-cats-wrap div-group-wishlist-content-<?php echo $_product->getId();?>">

        <div class="om-addto-wishlist-cats-topsection">
            <div class="row">
                <div class="col-md-4">
                    <div class="om-addto-wishlist-cats-img">
                        <img src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->resize(90); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />
                    </div>
                </div>
                <div class="col-md-8">
                    <div class="om-addto-wishlist-cats-title">
                        <h3><?php echo $this->htmlEscape($_product->getName()) ?></h3>
                        <?php $attribute_om_english_title = $_product->getResource()->getAttribute('om_english_title')->getFrontend()->getValue($_product); ?>
                        <?php if ($attribute_om_english_title) { ?>
                            <h4><?php echo $attribute_om_english_title; ?></h4>
                            <?php } ?>
                    </div>
                </div>
            </div>
        </div>
        <div class="om-addto-wishlist-cats-bottomsection">
            <div class="om-addto-wishlist-cats-select">
                <div class="row">
                    <div class="col-md-6">
                        <select id="slc-wishlist-groups-list-<?php echo $_product->getId();?>" productid="<?php echo $_product->getId();?>" class="om-slc-wishlist-group-list"></select>
                    </div>
                    <div class="col-md-6">
                        <div class="om-addto-wishlist-cats-input-text" id="div-wishlist-group-name-<?php echo $_product->getId();?>">
                            <?php /* <label for="txt-new-wishlist-group-name-<?php echo $_product->getId();?>">نام پوشه</label> */ ?>
                            <input type="text" id="txt-new-wishlist-group-name-<?php echo $_product->getId();?>" placeholder="نام دسته">
                        </div>
                    </div>
                </div>
            </div>
            <div class="om-addto-wishlist-cats-desc">
                <textarea placeholder="توضیحات" cols="5" rows="3" name="txa-group-wishlist-description-<?php echo $_product->getId(); ?>" id="txa-group-wishlist-description-<?php echo $_product->getId(); ?>"></textarea>
            </div>
            <div class="om-addto-wishlist-cats-action">
                <div class="row">
                    <div class="col-md-9">
                        <label>
                            <input type="checkbox" id="use-group-wishlist-form-<?php echo $_product->getId(); ?>">
                            دیگر این پیام را نمایش نده
                        </label>
                    </div>
                    <div class="col-md-3">
                        <a href='javascript&colon;void(0);' class="btn-add-product-to-group-wishlist" productid="<?php echo $_product->getId(); ?>">افزودن</a>
                        <div style="display: none;"> <a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="om-add-to-wishlist a-add-to-wishlist-group" id="a-add-to-wishlist-group-<?php echo $_product->getId();?>" title="افزودن به لیست علاقمندی"><i class="fa fa-heart"></i></a></div>
                    </div>
                </div>
                <div class="om-addto-wishlist-cats-attention">
                    <p>
                        <!-- <i class="fa fa-exclamation-circle"></i> -->
                        - با انتخاب این گزینه، محصولات مستقیما به لیست علاقمندی‌ها اضافه می‌شوند و در آنجا قابل دسته‌بندی و ویرایش هستند.
                        <br>
                        - برای فعالسازی دوباره این گزینه، پس از کلیک بر روی آیکون علاقمندی‌ها در بالای صفحه، به صفحه مدیریت علاقمندی‌ها مراجعه نمایید.
                    </p>
                </div>
            </div>
        </div>
    </div>
    <?php
        $write = Mage::getSingleton('core/resource')->getConnection('core_write');
        $arrCustomerWishlist=$write->fetchOne("SELECT  `wishlist_use_group`.`use_group_wishlist_form` FROM `wishlist_use_group` WHERE `wishlist_use_group`.`wishlist_id`=(SELECT wishlist_id FROM wishlist WHERE customer_id=".$customerData->getId().")");
        if($arrCustomerWishlist=='1' or $arrCustomerWishlist==''){
            $use_group_wishlist_form=1;
        }
        else{
            $use_group_wishlist_form=0;
        }
    }
    if($use_group_wishlist_form==0 or Mage::getStoreConfig('cartpro_cfg/general/enable_wishlist_group')==0){
    ?>
    <a href="<?php echo Mage::helper('wishlist')->getAddUrl($_product) ?>" class="om-add-to-wishlist" title="افزودن به لیست علاقمندی"><i class="fa fa-heart"></i></a>
    <?php
    }
    if($use_group_wishlist_form==1 and Mage::getStoreConfig('cartpro_cfg/general/enable_wishlist_group')==1){
    ?>
    <span class="om-showform-add-to-wishlist-group-link">
        <a href='javascript&colon;void(0);' class="om-add-to-wishlist om-add-to-group-wishlist" productid="<?php echo $_product->getId(); ?>" title="افزودن به لیست علاقمندی"><i class="fa fa-heart"></i></a>
    </span>
    <span class="om-dontshowform-add-to-wishlist-group-link" style="display: none;">
        <a href="<?php echo $this->helper('wishlist')->getAddUrl($_product); ?>" class="om-add-to-wishlist" title="افزودن به لیست علاقمندی"><i class="fa fa-heart"></i></a>
    </span>
    <?php
    }
?>