<?xml version="1.0"?>
<!--
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

-->
<layout version="0.1.0">
    <checkout_cart_index>
        <reference name="checkout.cart.top_methods">
            <block type="paypal/express_shortcut" name="checkout.cart.methods.paypal_express.top" before="-" template="paypal/express/shortcut.phtml">
                <action method="setIsQuoteAllowed"><value>1</value></action>
            </block>
        </reference>

        <reference name="checkout.cart.methods">
            <block type="paypal/express_shortcut" name="checkout.cart.methods.paypal_express.bottom" before="-" template="paypal/express/shortcut.phtml">
                <action method="setIsQuoteAllowed"><value>1</value></action>
            </block>
        </reference>

        <update handle="SHORTCUT_popup" />
    </checkout_cart_index>

    <paypal_express_review translate="label">
        <label>PayPal Express Order Review Form</label>
        <remove name="right"/>
        <remove name="left"/>

        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="paypal/express_review" name="paypal.express.review" template="paypal/express/review.phtml">
                <block type="paypal/express_review_billing" name="express.review.billing" as="billing" template="paypal/express/review/address.phtml"/>
                <block type="paypal/express_review_shipping" name="express.review.shipping" as="shipping" template="paypal/express/review/address.phtml"/>
                <block type="paypal/express_review" name="express.review.shipping.method" as="shipping_method" template="paypal/express/review/shipping/method.phtml"/>
                <block type="paypal/express_review_details" name="paypal.express.review.details" as="details" template="paypal/express/review/details.phtml">
                    <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
                    <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/onepage/review/item.phtml</template></action>
                    <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/onepage/review/item.phtml</template></action>
                    <block type="checkout/cart_totals" name="paypal.express.review.details.totals" as="totals" template="checkout/onepage/review/totals.phtml"/>
                </block>
                <block type="checkout/agreements" name="paypal.express.review.details.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>
            </block>
        </reference>
        <reference name="head">
            <action method="addItem"><type>skin_js</type><name>js/checkout/review.js</name></action>
        </reference>
        <block type="core/text_list" name="additional.product.info" />
    </paypal_express_review>

    <paypal_express_review_details>
        <block type="paypal/express_review_details" name="root" output="toHtml" template="paypal/express/review/details.phtml">
            <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
            <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/onepage/review/item.phtml</template></action>
            <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/onepage/review/item.phtml</template></action>
            <block type="checkout/cart_totals" name="paypal.express.review.details.totals" as="totals" template="checkout/onepage/review/totals.phtml"/>
        </block>
    </paypal_express_review_details>

<!--
Available logo types can be assigned with action="setLogoType":
 - wePrefer_150x60
 - wePrefer_150x40
 - nowAccepting_150x60
 - nowAccepting_150x40
 - paymentsBy_150x60
 - paymentsBy_150x40
 - shopNowUsing_150x60
 - shopNowUsing_150x40
-->
    <!--<catalog_product_view>
        <reference name="product.info.addtocart">
            <block type="page/html_wrapper" name="product.info.addtocart.paypal.wrapper" translate="label">
                <label>PayPal Express Checkout Shortcut Wrapper</label>
                <block type="paypal/express_shortcut" name="product.info.addtocart.paypal" template="paypal/express/shortcut.phtml">
                    <action method="setIsInCatalogProduct"><value>1</value></action>
                </block>
            </block>
        </reference>
        <update handle="SHORTCUT_popup" />
        <reference name="right">
            <block type="paypal/logo" name="paypal.partner.right.logo" template="paypal/partner/logo.phtml">
                <action method="setLogoType"><value>wePrefer_150x60</value></action>
            </block>
        </reference>
    </catalog_product_view>-->

   <!-- <catalog_category_default>
        <update handle="SHORTCUT_popup" />
        <reference name="right">
            <block type="paypal/logo" name="paypal.partner.right.logo" template="paypal/partner/logo.phtml"/>
        </reference>
    </catalog_category_default>-->

    <!--<catalog_category_layered>
        <update handle="SHORTCUT_popup" />
        <reference name="right">
            <block type="paypal/logo" name="paypal.partner.right.logo" template="paypal/partner/logo.phtml"/>
        </reference>
    </catalog_category_layered>-->

    <catalog_product_compare_index>
        <update handle="SHORTCUT_popup" />
    </catalog_product_compare_index>

    <catalogsearch_result_index>
        <update handle="SHORTCUT_popup" />
    </catalogsearch_result_index>

    <catalogsearch_advanced_result>
        <update handle="SHORTCUT_popup" />
    </catalogsearch_advanced_result>

    <tag_product_list>
        <update handle="SHORTCUT_popup" />
    </tag_product_list>
    <tag_customer_view>
        <update handle="SHORTCUT_popup" />
    </tag_customer_view>

    <wishlist_index_index>
        <update handle="SHORTCUT_popup" />
    </wishlist_index_index>
    <review_product_list>
        <update handle="SHORTCUT_popup" />
    </review_product_list>

    <checkout_onepage_success>
        <update handle="SHORTCUT_popup" />
    </checkout_onepage_success>
    <checkout_onepage_failure>
        <update handle="SHORTCUT_popup" />
    </checkout_onepage_failure>

    <!--<cms_index_index>
        <reference name="right">
            <block type="paypal/logo" name="paypal.partner.right.logo" template="paypal/partner/logo.phtml"/>
        </reference>
    </cms_index_index>-->

    <default>
        <reference name="topCart.extra_actions">
            <block type="paypal/express_shortcut" name="paypal.partner.top_cart.shortcut" template="paypal/express/shortcut.phtml"/>
        </reference>
        <reference name="cart_sidebar.extra_actions">
            <block type="paypal/express_shortcut" name="paypal.partner.cart_sidebar.shortcut" template="paypal/express/shortcut.phtml"/>
        </reference>
    </default>

    <checkout_onepage_review>
        <reference name="checkout.onepage.review.info.items.after">
            <block type="paypal/iframe" name="paypal.iframe" />
        </reference>
        <reference name="checkout.onepage.review.button">
            <action method="setTemplate"><template helper="paypal/hss/getReviewButtonTemplate"><name>paypal/hss/review/button.phtml</name><block>checkout.onepage.review.button</block></template></action>
        </reference>
    </checkout_onepage_review>

    <paypal_payflow_link_iframe>
        <block type="paypal/payflow_link_iframe" name="payflow.link.iframe" template="paypal/payflowlink/form.phtml" />
    </paypal_payflow_link_iframe>

    <paypal_payflow_advanced_iframe>
        <block type="paypal/payflow_advanced_iframe" name="payflow.advanced.iframe" template="paypal/payflowadvanced/form.phtml" />
    </paypal_payflow_advanced_iframe>

    <paypal_hosted_pro_iframe>
        <block type="paypal/hosted_pro_iframe" name="hosted.pro.iframe" template="paypal/hss/form.phtml"/>
    </paypal_hosted_pro_iframe>

    <SHORTCUT_popup>
        <reference name="product.tooltip">
            <block type="page/html_wrapper" name="product.info.addtocart.paypal.wrapper" translate="label">
                <block type="paypal/express_shortcut" name="product.info.addtocart.paypal" template="paypal/express/shortcut.phtml">
                    <action method="setIsInCatalogProduct"><value>1</value></action>
                    <action method="setShowOrPosition"><value>after</value></action>
                </block>
            </block>
        </reference>
    </SHORTCUT_popup>
</layout>
