Magento Adjust Product detail Page customization options or the location of configuration items

Source: Internet
Author: User

Default location such as, feel not beautiful

After adjustment, such as

Open the Background product page and find the display product options in property under Design, you can see two options: Product Info column and block after Info column, where block after is selected by default Info column, which is literally understandable, the content of options is displayed below the product information by default, and if the display product options in property is set to the products info Column, The front desk will see the effect of the second picture. That is, the Magento system itself provides two display locations for this piece, which can be chosen by modifying the property values in the background, but the problem is that if I want the options for all products to appear by default in the product Info Column, Instead of all the products opened to change the properties, it is necessary to modify the code to achieve.

Open the main template file for the product page view.phtml, you can see similar code on both ends, the first one is as follows

1<?phpif($_product->issaleable () &&$this->hasoptions ()):?>2<?phpif($container 1_html=$this->getchildchildhtml (' Container1 ', ',true,true)):?>3<divclass= "Container1-wrapper" ><?phpEcho $container 1_html;?></div>4<?phpendif;?>5<?phpendif;? >

A second

1<?phpif($_product->issaleable () &&$this->hasoptions ()):?>2<?phpif($container 2_html=$this->getchildchildhtml (' Container2 ', ',true,true)):?>3<divclass= "Box-additional <?php Echo$grid[' Cont2col '];?> ">4<divclass= "Container2-wrapper" ><?phpEcho $container 2_html;?></div>5</div>6<?phpendif;?>7<?phpendif;?>

These two paragraphs are the product Info column and the block after Info column two locations, from the location of the code in the view.phtml can be seen, the background is the default block after Info column case, Information will be displayed in Container2. Now cut container2 this piece of code, put it in the same position as container1, so that the new product by default, the options will be displayed in the second picture shows the location, the template file in the final code is as follows:

1<?phpif($_product->issaleable () &&$this->hasoptions ()):?>2<?phpif($container 1_html=$this->getchildchildhtml (' Container1 ', ',true,true)):?>3<divclass= "Container1-wrapper" ><?phpEcho $container 1_html;?></div>4<?phpendif;?>5<?phpendif;? >6<?phpif($_product->issaleable () &&$this->hasoptions ()):?>7<?phpif($container 2_html=$this->getchildchildhtml (' Container2 ', ',true,true)):?>8<divclass= "Box-additional <?php Echo$grid[' Cont2col '];?> ">9<divclass= "Container2-wrapper" ><?phpEcho $container 2_html;?></div>Ten</div> One<?phpendif;?> A<?phpendif;?>

Magento Adjust Product detail Page customization options or the location of configuration items

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.