Showing posts with label Replace. Show all posts
Showing posts with label Replace. Show all posts

Friday 13 May 2016

How to replace string with regex in jQuery Javascript in Html with Using nodeType / node Shortcode


How to replace string with regex in jQuery Javascript in Html with Using nodeType / node

Text

[jems-countdown token="4" data-id="20136582"]

Script

jQuery(document).ready(function(){
   
    $('body *').contents().each(function() {
        if(this.nodeType == 3) {
            var u = this.nodeValue;
            var reg = /\[(jems-countdown.*)\]/g;
            $(this).replaceWith(u.replace(reg,'<div class="metcounter" $1>kanasagra</div>'));
        }
    });
  });

Tuesday 2 June 2015

How to replace word in database in mysql PHP


UPDATE student SET firstname = replace(firstname, 'jaydip', 'Kansagra');




 How to create multilingual static block in controller

$deliveryBlock = Mage::getModel('cms/block')->load('delivery_returns'); echo $deliveryBlock->getTitle(); echo $deliveryBlock->getContent(); 

Search does not return results in magento


Open your file Mage_CatalogSearch_Model_Layer and in method

public function prepareProductCollection($collection)
 
before return $this;

Add following rows:

Mage::log($collection->getSelectSQL(1), false, 'search.log', true);
Mage::log((array)Mage::getConfig()->getNode()->global->models->catalogsearch, false, 'search.log', true)

 OR

Goto -> admin->attributs->manage attribute-> search sku - open it -> Frontend Properties-> Use in Quick Search (YES )