Wednesday 16 April 2014

Get all images tags from the remote url through php

In some project i need to get all image tags from the remote url
I have google a lot but not getting any particular solution.
But atlast i got a very good code which works like a charm

you can find that code on

https://docs.google.com/file/d/0B9cbYvYQ9b0YY2xxUW5kUms0NWM/edit

in this file you will see the below code at very last of file


// Create DOM from URL or file
$html = file_get_html('https://www.google.co.in/'); // replace your url

// Find all images
foreach($html->find('img') as $element) // to get all image src  from the url
       echo $element->src . '<br>';

// Find all links
foreach($html->find('a') as $element) // to get all anchor tags  from the url
       echo $element->href . '<br>';


with this script you can get any paramaeter from the remote url.  Remember to copy the full file from the downlaod file from here






      

Wednesday 9 April 2014

Show popular search terms in sidebar Magento

Hi in some project i need to show the popular search terms in the sidebar . For that i have use the following code


  <reference name="right">
            <!-- Search Terms -->
            <block type="catalogsearch/term" after="cart.sidebar" name="catalogsearch.term" template="catalogsearch/term.phtml"/>
        </reference>


you can place this code in the  catalog.xml file of your theme