<?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@magento.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.magento.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.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="paypaluk/express_shortcut" name="checkout.cart.methods.paypaluk_express.top" before="-" template="paypal/express/shortcut.phtml">
                <action method="setIsQuoteAllowed"><value>1</value></action>
            </block>
        </reference>
        <reference name="checkout.cart.methods">
            <block type="paypaluk/express_shortcut" name="checkout.cart.methods.paypaluk_express.bottom" before="-" template="paypal/express/shortcut.phtml">
                <action method="setIsQuoteAllowed"><value>1</value></action>
            </block>
        </reference>

        <update handle="SHORTCUT_uk_popup" />
    </checkout_cart_index>

    <paypaluk_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">
                <action method="setPaypalActionPrefix"><prefix>paypaluk</prefix></action>
                <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>
    </paypaluk_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>

    <catalog_product_view>
        <reference name="product.info.addtocart">
            <block type="page/html_wrapper" name="product.info.addtocart.paypaluk.wrapper" translate="label">
                <label>PayPal Express Checkout (Payflow Edition) Shortcut Wrapper</label>
                <action method="setHtmlTagName"><tag>p</tag></action>
                <action method="setElementClass"><class>paypal-logo</class></action>
                <block type="paypaluk/express_shortcut" name="product.info.addtocart.paypaluk" template="paypal/express/shortcut.phtml">
                    <action method="setIsInCatalogProduct"><value>1</value></action>
                </block>
            </block>
        </reference>
        <update handle="SHORTCUT_uk_popup" />
    </catalog_product_view>

    <default>
        <reference name="topCart.extra_actions">
            <block type="paypaluk/express_shortcut" name="paypaluk.partner.top_cart.shortcut" template="paypal/express/shortcut.phtml"/>
        </reference>
        <reference name="cart_sidebar.extra_actions">
            <block type="paypaluk/express_shortcut" name="paypaluk.partner.cart_sidebar.shortcut" template="paypal/express/shortcut.phtml"/>
        </reference>
    </default>

    <catalog_category_default>
        <update handle="SHORTCUT_uk_popup" />
    </catalog_category_default>

    <catalog_category_layered>
        <update handle="SHORTCUT_uk_popup" />
    </catalog_category_layered>

    <catalog_product_compare_index>
        <update handle="SHORTCUT_uk_popup" />
    </catalog_product_compare_index>

    <catalogsearch_result_index>
        <update handle="SHORTCUT_uk_popup" />
    </catalogsearch_result_index>

    <catalogsearch_advanced_result>
        <update handle="SHORTCUT_uk_popup" />
    </catalogsearch_advanced_result>

    <tag_product_list>
        <update handle="SHORTCUT_uk_popup" />
    </tag_product_list>
    <tag_customer_view>
        <update handle="SHORTCUT_uk_popup" />
    </tag_customer_view>

    <wishlist_index_index>
        <update handle="SHORTCUT_uk_popup" />
    </wishlist_index_index>

    <review_product_list>
        <update handle="SHORTCUT_uk_popup" />
    </review_product_list>

    <checkout_onepage_success>
        <update handle="SHORTCUT_uk_popup" />
    </checkout_onepage_success>
    <checkout_onepage_failure>
        <update handle="SHORTCUT_uk_popup" />
    </checkout_onepage_failure>

    <SHORTCUT_uk_popup>
        <reference name="product.tooltip">
            <block type="page/html_wrapper" name="product.info.addtocart.paypaluk.wrapper" translate="label">
                <block type="paypaluk/express_shortcut" name="product.info.addtocart.paypaluk" template="paypal/express/shortcut.phtml">
                    <action method="setIsInCatalogProduct"><value>1</value></action>
                    <action method="setShowOrPosition"><value>after</value></action>
                </block>
            </block>
        </reference>
    </SHORTCUT_uk_popup>
</layout>
