How to share custom data on social network site !!!

For Facebook share

<a id="ref_fb" href="http://www.facebook.com/sharer.php?s=100&amp;p[title]=<?php echo $ftitle;?>&amp;p[summary]=<?php echo $fdescription;?>&amp;p[url]=<?php echo urlencode($fshare_url);?>&amp;
p[images][0]=<?php echo $fimage_url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600'); return false;">&nbsp;</a>

For Twitter share

<a id="ref_tw" href="http://twitter.com/home?status=<?php echo $ttitle; ?>+<?php echo urlencode($tshare_url);?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600');return false;">&nbsp;</a>
 

For Linkedin share

<a id="ref_lkd" href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo urlencode($lshare_url);?>&title=<?php echo strip_tags($ltitle); ?>&source=<?php echo urlencode($siteurl);?>"onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600');return false;">&nbsp;</a>

For Google+ share

<a id="ref_gp" href="https://plus.google.com/share?url=<?php echo urlencode($gshare_url);?>"
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600');return false">&nbsp;</a>
Please define  values  of varibles for better result !!!  
Advertisements

5 thoughts on “How to share custom data on social network site !!!

  1. i want to brand page like this link ( brand make category)
    http://www.johnlewis.com/brands

    and i have below type of code

    __(‘All Brands’) ?>
    __(‘Naviga per Brand’) ?>

    load(11)->getChildren();
    $catIds = explode(‘,’,$cats);

    $categories = array();
    foreach($catIds as $catId) {
    $category = Mage::getModel(‘catalog/category’)->load($catId);
    $categories[$category->getName()] = array(
    ‘url’ => $category->getUrl(),
    ‘img’ => $category->getImageUrl()
    );
    }

    ksort($categories, SORT_STRING);
    $newbrandarray=array();
    ?>

    $data):
    $newbrandarray[]=ucfirst($name);
    ?>

    <!– __(‘Brand’) ?> –>
    <?php

    sort($newbrandarray);

    $alphaArray = array();
    foreach($alphabet as $char) {
    foreach($newbrandarray as $brand) {
    //echo $char."–".substr($brand, 0, 1); exit;
    $a=strtoupper(substr($brand, 0, 1));
    if($char == $a) {
    $alphaArray[$char][] = $brand;
    }
    }
    }
    $i=0;
    $j=0;
    //echo "

    ";print_r($alphaArray);
    ?>
     $group) { 
     ?>
    
    <div class="mainrow ">
    <div id="" class="alpha-title">
      
      
    
    
      
      
      	<a href="">
    		
        
      
      
    
    
    
    
    ....so how can i do for it
    

    Like

  2. Hi,
    This is something very bespoke. I need to review the whole code and see what can be done. But what you can do is Get all the brand names and display it based on the initial character. Then while clicking on the brand you can fire a query such that attribute value is the name of brand.

    Meanwhile, i’ll try it out myself. Also if you achieve this could you please mail what you did. We would like to feature your article on our blog.

    Thanks for commenting

    Like

    • (1) i put this code in catalog/product/brand.phtml

      getAttribute(‘catalog_category’, ‘country’); ?>
      getRequest()->getParam(‘country_code’); ?>
      getSource()->getAllOptions(true, true); ?>

      <img src="getSkinUrl(‘images/brandcatimg.png’) ?>” />

      getLayout()->createBlock(‘cms/block’)->setBlockId(‘contattitoptitle’)->toHtml(); ?>

      Seleziona

      <option value="” selected=”selected” >

      <img src="getSkinUrl(‘images/register.png’) ?>” />

      load(11)->getChildren();
      $catIds = explode(‘,’,$cats);

      $categories = array();
      foreach($catIds as $catId) {
      $category = Mage::getModel(‘catalog/category’)->load($catId);
      if($country_value != “”){
      if($country_value==$category->getCountry()){
      $categories[$category->getName()] = array(
      ‘url’ => $category->getUrl(),
      ‘decs’ => $category->getDescription()
      );
      }
      }else{
      $categories[$category->getName()] = array(
      ‘url’ => $category->getUrl(),
      ‘decs’ => $category->getDescription()
      );
      }
      }

      ksort($categories, SORT_STRING);
      $newbrandarray=array();
      ?>

      $data):
      $newbrandarray[]=ucfirst($name);
      ?>

      <?php

      sort($newbrandarray);

      $alphaArray = array();
      foreach($alphabet as $char) {
      foreach($newbrandarray as $brand) {
      //echo $char."–".substr($brand, 0, 1); exit;
      $a=strtoupper(substr($brand, 0, 1));
      if($char == $a) {
      $alphaArray[$char][] = $brand;
      }
      }
      }
      $i=0;
      $j=0;
      //echo "

      ";print_r($alphaArray);
      ?>
      
      
      A
      B
      C
      D
      E
      F
      G
      H
      I
      J
      K
      L
      M
      N
      O
      P
      Q
      R
      S
      T
      U
      V
      W
      X
      Y
      Z
       
       $group) { 
       ?>
      <div id=""  class="mainrow " style="display:none">
      
        
        
      
      
        
          
              
        
         <a href="">
        
          
          
        
        
      
      
      
      
      
      jQuery(document).ready( function() {
        jQuery('#A').css('display','block'); 
        jQuery("ul.index-navigation li a").click(function(num) {
          jQuery("ul.index-navigation li").removeClass("selected");
        jQuery(this).parent('li').addClass('selected');
        jQuery(".mainrow").hide('fast');
        jQuery(".mainrow"+jQuery(this).attr('href')).slideDown();
        return false;
       });
      });
      function getselection()
      {
       var selectedval = document.getElementById('country_id').value;
       window.location.href = "http://enotecad.nextmp.net/cantine.html?country_code="+selectedval;
      }
      
      
      (2) make one statick block  and call 
      {{block type="catalog/product" name="home.catalog.product" template="catalog/product/brand.phtml"}}
      

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s