Magento Forum

   
add price to content above in catalog.xml
 
Michal_s
Sr. Member
 
Total Posts:  111
Joined:  2008-05-15
The Netherlands
 

why is it so hard to get the price of the chosen product in content above, i got so far to get the other info like name media etc in conten above but not the price

<reference name="content-above">        
 <
block type="catalog/product_view" name="product.buy" template="catalog/product/buy.phtml">

                <!--
                <
action method="addReviewSummaryTemplate"><type>default</type><template>review/helper/summary.phtml</template></action>
                <
action method="addReviewSummaryTemplate"><type>short</type><template>review/helper/summary_short.phtml</template></action>
                <
action method="addReviewSummaryTemplate"><type>...</type><template>...</template></action>
                -->
                <
block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
                <
block type="core/text_list" name="alert.urls" as="alert_urls" />
                <
block type="catalog/product_view" name="product.tierprices" as="tierprices" template="catalog/product/view/tierprices.phtml"/>

                <
block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml">
                    <
action method="setColumnCount"><columns>4</columns></action>
                    <
action method="setItemLimit"><type>upsell</type><limit>4</limit></action>
                </
block>

                <
block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
                <
block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml"/>
                <
block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml"/>
                <
block type="catalog/product_view" name="product.info.addto" as="addto" template="catalog/product/view/addto.phtml"/>
                <
block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>


                <
block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml">
                    <
block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
                        <
action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
                        <
action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
                        <
action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
                        <
action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
                    </
block>
                </
block>
                
                <
block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="catalog/product/view/options/wrapper/bottom.phtml">
                    <
action method="insert"><block>product.tierprices</block></action>
                    <
block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
                    <
action method="append"><block>product.info.addtocart</block></action>
                </
block>

                <
block type="core/template_facade" name="product.info.container1" as="container1">
                    <
action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
                    <
action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
                    <
action method="append"><block>product.info.options.wrapper</block></action>
                    <
action method="append"><block>product.info.options.wrapper.bottom</block></action>
                </
block>
                <
block type="core/template_facade" name="product.info.container2" as="container2">
                    <
action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
                    <
action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
                    <
action method="append"><block>product.info.options.wrapper</block></action>
                    <
action method="append"><block>product.info.options.wrapper.bottom</block></action>
                </
block>
                <
action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
                <
action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>





 
 </
block>

        </
reference>

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michal_s
Sr. Member
 
Total Posts:  111
Joined:  2008-05-15
The Netherlands
 

when i place in buy.phtml the next line

<?php echo $this->htmlEscape($_product->getPrice()) ?>

it echos the old not discounted price…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michal_s
Sr. Member
 
Total Posts:  111
Joined:  2008-05-15
The Netherlands
 

got it workin by adding

<reference name="product.buy">
<block type="catalog/product_view_type_simple" name="product.info.simple" as="product_type_data" template="catalog/product/view/type/simple.phtml"/>
</reference>

in

<!--
Additional block dependant on product type
-->

also changed some product.view into product.buy if someone is interested i can post the catalog.xml

ps, if some could give me workin code with a cleaner xml file then please post it

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