Magento Forum

   
2 different checkout layouts
 
warwickmc
Member
 
Total Posts:  33
Joined:  2008-07-14
 

hi there,

fairly new to magento, and i was wondering if anyone would be able to give me a bit of a clue on where to start or if anyone has had any luck in performing a similar task. i wish to get an if conditional statement into magento so it can check if the cart value equals zero and then provide a layout depenant upon that, similar to the way that magento removes the shipping section of onepage. if someone could point out to me where magento performs that check and changes onepage accordingly that would be fantastic, any help at all would be greatly appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
fenixf
Member
 
Total Posts:  35
Joined:  2008-04-08
 

I am looking also for something simular:

At which point cq in what file is determined to use the view.phtml file for the product?

So that I could choose to use another templatefile dynamically, that means without changing the xml file.

 
Magento Community Magento Community
Magento Community
Magento Community
 
butterbrot
Member
 
Total Posts:  51
Joined:  2008-10-26
 

take a look at the “Design"-tab inside the manage product panel.

you can create a new theme and copy only the files you wish to change.

or try using the xml file, it allows you to change designs for certain products, and product types. <PRODUCT_{ID}>… or something

the ProductController.php inside the catalog module should tell you more.

 
Magento Community Magento Community
Magento Community
Magento Community
 
fenixf
Member
 
Total Posts:  35
Joined:  2008-04-08
 
butterbrot - 26 October 2008 02:33 PM

take a look at the “Design"-tab inside the manage product panel.

you can create a new theme and copy only the files you wish to change.

I want to change the templatefile dynamically, based on let’s say the atrributeset of that product.
for one product view1.phtml
for an other view2.phtml

You get it?

butterbrot - 26 October 2008 02:33 PM

or try using the xml file, it allows you to change designs for certain products, and product types. <PRODUCT_{ID}>… or something

Is that possible?  like arguments? Give me an example where certain products use different templatefiles. Are you sure about this?

butterbrot - 26 October 2008 02:33 PM

the ProductController.php inside the catalog module should tell you more.

That’s where I am right now,

protected function _initProductLayout($product)
    
{
        
        $update 
$this->getLayout()->getUpdate();

        
$update->addHandle('default');
        
$this->addActionLayoutHandles();

        
$update->addHandle('PRODUCT_TYPE_'.$product->getTypeId());
        
$update->addHandle('PRODUCT_'.$product->getId());

        
$this->loadLayoutUpdates();
    
        
$update->addUpdate($product->getCustomLayoutUpdate());

        
$this->generateLayoutXml()->generateLayoutBlocks();

        
$currentCategory Mage::registry('current_category');
        if (
$root $this->getLayout()->getBlock('root')) {
            $root
->addBodyClass('product-'.$product->getUrlKey());
            if (
$currentCategory instanceof Mage_Catalog_Model_Category{
                $root
->addBodyClass('categorypath-'.$currentCategory->getUrlPath())
                    ->
addBodyClass('category-'.$currentCategory->getUrlKey());
            
}
        }

        
return $this;
    
}

I have a feeling there could be some bug here.

putting:

<action method="setTemplate"><template>catalog/poduct/view2.phtml</template></action>
in the custom layout update box is not changing the template file.
putting it in the catalog.xml does work.

doing something like:

$update->addUpdate('<action method="setTemplate"><template>catalog/product/view2.phtml</template></action>')

doesn’t work either

I am stuck here....

Somebody has a hint?

 
Magento Community Magento Community
Magento Community
Magento Community
 
warwickmc
Member
 
Total Posts:  33
Joined:  2008-07-14
 

hey guys thanks for you reply, not really what i was looking for though, im looking for something more to do with the checkout as opposed to the product layout, which seems to be much simpler and handled through the custom design option in the backend, which as far as im aware doesnt encompass the checkout, unless you can, im which case someone can gladly correct me on that, would make my job a lot easier wink

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top