Wednesday, July 27, 2016

Magento: list all values of a single attribute

 $name='product_attribue_name';
    $attributeInfo =     Mage::getResourceModel('eav/entity_attribute_collection')->setCodeFilter($name)->getFirstItem();
    $attributeId = $attributeInfo->getAttributeId();
    $attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
    $attributeOptions = $attribute ->getSource()->getAllOptions(false);
    echo '<pre>'; print_r($attributeOptions);

Tuesday, July 26, 2016

Magento- get product collection by customer reviews

Magento- get product collection by customer reviews

<?php
$collection = Mage::getModel('review/review')
                ->getResourceCollection()
                ->addStoreFilter(Mage::app()->getStore()->getId())
                ->addFieldToSelect('*')
                ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
                ->addRateVotes();
$collection->getSelect()->group('entity_pk_value');
               
//echo $collection->getSelect();

print_r($collection->getData());

?>

Monday, July 18, 2016

CSS- Responsive Masonry Layout using Only CSS without jQuery

<html>
<head>
<title>Masonry Layout</title>
<style>

*, *:before, *:after {box-sizing:  border-box !important;}
article {-moz-column-width: 13em; -webkit-column-width: 13em;-moz-column-gap: 1em; -webkit-column-gap: 1em; }
section {display: inline-block;margin:  0.25rem;padding:  1rem;width:  100%; background:  #efefef;}



</style>

</head>

<body>
<h1>Pure CSS Masonry</h1>
<p>By using CSS3 columns, we can easily create a Masonry.js-like layout where random-height blocks fit together.</p>

<article>

  <section>
    <p>Lorem ipsum dolor sit amet, consectetur.</p>
  </section>
 
  <section>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error aliquid reprehenderit expedita odio beatae est.</p>
  </section>
 
  <section>
    <p>Lorem ipsum dolor sit amet, consectetur.</p>
  </section>
 
  <section>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nobis quaerat suscipit ad.</p>
  </section>

  <section>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem nihil alias amet dolores fuga totam sequi a cupiditate ipsa voluptas id facilis nobis.</p>
  </section>


  <section>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem ut debitis dolorum earum expedita eveniet voluptatem quibusdam facere eos numquam commodi ad iusto laboriosam rerum aliquam.</p>
  </section>
 
  <section>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
  </section>
 
  <section>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat  architecto quis tenetur fugiat veniam iste molestiae fuga labore!</p>
  </section>
 
  <section>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odit accusamus tempore at porro officia rerum est impedit ea ipsa tenetur. Labore libero hic error sunt laborum expedita.</p>
  </section>
 
  <section>
    <p>Lorem ipsum dolor sit.</p>
  </section>
 
  <section>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima asperiores eveniet vero velit eligendi aliquid in.</p>
  </section>
 
  <section>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloribus dolorem maxime minima animi cum.</p>
  </section>
 
</article>
</body>

</html>

OUTPUT:  

 

Friday, July 15, 2016

Some Very Common Interview Questions and Answer

Here are some possible interview questions with answers, answers may not be the perfect one but it will give an idea what actually interviewer wants to ask.

Q1.How would you describe your personality?
Answer: "I'm pretty even-tempered. I enjoy being part of a team and feel comfortable both making decisions and following directions."

Q2.Tell me about yourself and your past experience?
Answer: "I have been working in Information Technology industry for last 4-5 years. I had an opportunity to work in teams and independently. I am very comfortable in both the environments. I have developed Client/Server and Intranet applications, involving full life cycle, which includes Requirement Phase, Analysis/Design, Development, Unit Testing, Integrating Testing, Customer/User Testing, and Rollout/Implementation. I have worked on various tools in my career, which includes MS Access, MS SQL Server, SQL, VBA, JavaScript, VB Script, COM/DCOM, ADO, Active X, ASP, HTML, DHTML, XML, XSL, CSS, Visual InterDev, Visual Basic, FrontPage, Dreamweaver, Flash, Visual Source Safe and Adobe PhotoShop. I have always met the project deadlines, for which I had to work late hours and weekends. For the past two years, I have been working as a Web Developer. Where I have involved in the beginning of the project itself, i.e., Requirement gathering phase. Online Job Search is a successful multi-tier web-based application, which uses MS SQL Server 7.0 as backend data store and Visual Basic 6.0 and ASP as front-end. It provides a user-friendly platform for Job Seekers as well as Job Submitters, from across the globe to register, search and submit Vacancies in their local areas. We had meetings with the Customers/Users to get all the required information. This application gives various functionalities (forgotten password, Mailing list and etc) and different security levels to the Users and Administrators. My strengths are my client-relationship management skills, and my leadership ability."


Q3.Why are you leaving your current job?
Answer:Forget about the fact that you hate your boss and your co-workers drive you crazy. Instead, say, "I'm ready to take on more responsibilities and learn more, but the opportunities at my current job are limited. Or I've set some goals for myself and my career, and unfortunately I'm at a standstill in my current situation. I have begun to explore options available before I spend too much time in a job where I can't advance. My goal is to continue to take on new responsibilities and be a key contributor to the success of an online venture."