Custom Search

Domain Driven Designs

Displaying Product Images of Associated Products with Configurable Products in Magento

<?php

        $assoc_product = Mage::getModel(‘catalog/product’)->load($child->getId());     
        echo $assoc_product->getName();
        foreach($assoc_product->getMediaGalleryImages() as $assoc_product_img){ ?>
       
        <div>
          <img src=’<?php echo $this->helper(‘catalog/image’)->init($assoc_product, ‘thumbnail’, $assoc_product_img->getFile())->resize(70, 70); ?>‘ />
        </div> 
       
        <?php } ?>

The complete snippet is here

<?php

$product = Mage::getModel(‘catalog/product’);
$parent = $product->load($_product->getId());
$children = Mage::getModel(‘catalog/product_type_configurable’)->getUsedProductCollection($parent);
$xxx = $parent->getResource()->getAttribute(‘Color’)->getFrontend()->getValue($parent);
foreach($children as $child){  
   $child = $product->load($child->getId()); ?>
 
                <div>
        <a href="<?php echo $this->helper(‘catalog/image’)->init($child, ‘image’); ?>" id="<?php echo "link".$child->getResource()->getAttribute(‘Color’)->getFrontend()->getValue($child); ?>">
          <img src="<?php echo $this->helper(‘catalog/image’)->init($child, ‘image’); ?>" id="<?php echo "img".$child->getResource()->getAttribute(‘Color’)->getFrontend()->getValue($child); ?>" />
        </a>
       
        <?php
        $assoc_product = Mage::getModel(‘catalog/product’)->load($child->getId());     
        echo $assoc_product->getName();
        foreach($assoc_product->getMediaGalleryImages() as $assoc_product_img){ ?>
       
        <div>
          <img src=’<?php echo $this->helper(‘catalog/image’)->init($assoc_product, ‘thumbnail’, $assoc_product_img->getFile())->resize(70, 70); ?>‘ />
        </div> 
       
        <?php } ?>
       

         
        </div>
       
       
       
<?php } ?>

Code Igniter instead of Magento

There are some situations where you need to take a cab instead of taking MRT. The other day, I decided to code an online transaction from scratch and it took me 20 hours to do the backend and frontend using code igniter instead of magento, If I use magento to implement it, the complexity in tweaking magento will add me more stress. Thank God to understanding of MVC pattern I rapidly develop the Application in no time at all compared to the complexity and stress magento is giving me everytime a client what some fancy functionality.
I’ve finally appreciated the value of Rapid Application Development tools like Code Igniter.

Ecommerce designer Singapore

I tried to search for ecommerce developer in singapore using google search engine, as expected this blog is in the first page results, but when I try to search for ecommerce designer Singapore, this blog is nowhere to be found in the first page.

People might think that I can only do development for them, well… I do both actually from concept design ,analysis of design for integration, existing ecommerce platform, template conversation of design draft in raw psd files , development and script installation to live deployment and payment gateway integration like google checkout and PayPal.

I am expecting this blog to be on the first page of google search engine result for the keyword ecommerce designer singapore.

Payroll software vendor singapore

We are in the design phase for our payroll software solution , this software will be built on top of the zend framework and is going to be deployed in the cloud first in windows azure and then Google app engine.

We are aiming to be the number one payroll software provider for sme companies in singapore. This payroll system will have a package of free helpdesk and maintenance for a certain amount of time.

If you have system that requires a very customized payroll modules you can always rely on our team.

So keep in mind… need a payroll solution? We have it for you.

Payroll system Singapore

We are currently arming for a payroll system which is going to be deployed in Linux servers,  my first choice is asp.net mvc but I am not sure if it is supported on the engine that can run asp.net apps to Linux (forgot the name of the engine). So the second choice is PHP, since it is the closest language I am fluent in using next to c#. But building payroll system from scratch is a total pain how much more if I code everything from zero. I have to pick a reliable framework for this. I have a little  experience in cakephp and code igniter but I think this frameworks are still babys frameworks, I need a framework that has proven record and is used in enterprise level of applications. Enter Zend framework,  used by varien to build there magento ecommerce platform, hmmmm…. so I made my choice, zend.

I downloaded the manual documentation and yep, it is in mvc pattern.  So this thing is pretty easier for me.

Now the business analysis part, I am not an accounting Guy, I need to research on how payrolls flow, I really don’t care about this stuffs before.

I will be posting here the codes and scenarios as I move along with this project. Stay tune.

How to Get or Invoke Products and Display using Magento Php Code

To invoke the Products

$products =  Mage::getModel(‘catalog/product’)->getCollection()->addAttributeToSelect(‘name’);                             
$products->load();

and please don’t forget the $products->load(); part.

I spent 20 minutes figuring out what happen why Products are not showing up until I figure out the I forgot to load the call.

next is

foreach($products as $item){
             
               //you can display the attributes here
              $item->getName();
              $item->getProductUrl();
             // …. and so on the so forth…..
        }

Words and Thoughts on Domain Driven Designs

Domain Driven Design, a paradigm in the world of software engineers, reading books and articles about this gives me a nose bleed… blahh, blahhh, blahhh..!!!