简体   繁体   中英

Add Specifications for products in magento

I need to add specifications for certain products in product detail page from back end in magento, For example the specifications to be shown in frond end

<h2>Specifications</h2>
<ul>
<li>Spacing: 3 to 20 feet (0,9 to 6,1 m).</li>
<li>Pressure: 15 to 70 psi (1 to 5 bar).</li>
<li>Regulates nozzle pressure to an average 30 psi (2.1 bar) with inlet pressures of up to 70 psi (4.8 bar).</li>
<li>Flow-by: 0 at 8 psi (0.6 bar) or greater; 0.1 gpm (0.02 m3/h; 0.006 l/s) otherwise.</li>

<li>Installation: bottom inlet.</li>
</ul>
<h2>Dimensions</h2>
<ul>
<li>1/2" (15/21) female threaded inlets</li>
<li>Body height: 6" (15,2 cm) body height; 4" pop-up height (10,2 cm)</li>
<li>Exposed surface diameter: 2 1/4" (5,7 cm) </li>
</ul>

您好,您将为规范创建属性

If you create a new attribute for each item in the specification the Magento's default theme will show this as additional info in a nice table. Depending on your theme you could edit the table to display as you wish.

The benefit of doing your specification this way allows your products to be compared on each of the specification name:value pairs.

If none of that is an option then you can create one attribute called specification with an attribute code of spec_table and set the type as text area allowing you to enter the HTML you supplied. With this attribute set you can check for the field and output in your product/view.phtml file like so:

if($specTable = $_product->getResource()->getAttribute('spec_table')->getFrontend()->getValue($_product)) { echo $specTable }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM