0

enter image description hereWe want to add Discount coupon code box on checkout page. This coupon code box showing only on cart page we also want on checkout page.

  • Can you show screenshot where you want to show coupon on checkout? – Chirag Rajput Apr 5 '18 at 11:40
  • yes we added screen shot – Neha Khedkar Apr 5 '18 at 11:58
  • Please check my answer and let me know – Chirag Rajput Apr 5 '18 at 13:39
0

In checkout.xml layout file add as following,

<block type="checkout/onepage_review_info" name="root" output="toHtml" template="checkout/onepage/review/info.phtml">    
...    
    <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>    
...    
</block>

And put the following code in app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/onepage/review/info.phtml

<?php echo $this->getChildHtml('coupon') ?>
  • can you please share the checkout.xml file path – Neha Khedkar Apr 5 '18 at 11:19
  • @NehaKhedkar layout/checkout.xml – Emipro Technologies Pvt. Ltd. Apr 5 '18 at 11:22
  • 1
    sorry bt it is not working – Neha Khedkar Apr 5 '18 at 11:38
  • After applying promo code it redirect to cart page. How to change this behaviour – Arjun Kariyadan Oct 29 at 10:53
0

Open your theme files checkout.xml in layout app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout/checkout.xml

You can see code for replace that code with below:

<checkout_onepage_index translate="label">
    <label>One Page Checkout</label>
    <!-- Mage_Checkout -->
    <remove name="left"/>

    <reference name="root">
        <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
    </reference>
    <reference name="right">
        <action method="unsetChildren"></action>
        <block type="page/html_wrapper" name="checkout.progress.wrapper" translate="label">
            <label>Checkout Progress Wrapper</label>
            <action method="setElementId"><value>checkout-progress-wrapper</value></action>
            <block type="checkout/onepage_progress" name="checkout.progress" before="-" template="checkout/onepage/progress.phtml">
                <block type="checkout/onepage_progress" name="billing.progress" template="checkout/onepage/progress/billing.phtml"></block>
                <block type="checkout/onepage_progress" name="shipping.progress" template="checkout/onepage/progress/shipping.phtml"></block>
                <block type="checkout/onepage_progress" name="shippingmethod.progress" template="checkout/onepage/progress/shipping_method.phtml"></block>
                <block type="checkout/onepage_progress" name="payment.progress" template="checkout/onepage/progress/payment.phtml"></block>
        <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/> 
            </block>

        </block>
    </reference>
    <reference name="content">
        <block type="checkout/onepage" name="checkout.onepage" template="checkout/onepage.phtml">
            <block type="checkout/onepage_login" name="checkout.onepage.login" as="login" template="checkout/onepage/login.phtml">
                <block type="page/html_wrapper" name="checkout.onepage.login.before" as="login_before" translate="label">
                    <label>Login/Registration Before</label>
                    <action method="setMayBeInvisible"><value>1</value></action>
                </block>
            </block>
            <block type="checkout/onepage_billing" name="checkout.onepage.billing" as="billing" template="checkout/onepage/billing.phtml"/>
            <block type="checkout/onepage_shipping" name="checkout.onepage.shipping" as="shipping" template="checkout/onepage/shipping.phtml"/>
            <block type="checkout/onepage_shipping_method" name="checkout.onepage.shipping_method" as="shipping_method" template="checkout/onepage/shipping_method.phtml">
                <block type="checkout/onepage_shipping_method_available" name="checkout.onepage.shipping_method.available" as="available" template="checkout/onepage/shipping_method/available.phtml"/>
                <block type="checkout/onepage_shipping_method_additional" name="checkout.onepage.shipping_method.additional" as="additional" template="checkout/onepage/shipping_method/additional.phtml"/>
            </block>
            <block type="checkout/onepage_payment" name="checkout.onepage.payment" as="payment" template="checkout/onepage/payment.phtml">
                <block type="checkout/onepage_payment_methods" name="checkout.payment.methods" as="methods" template="checkout/onepage/payment/info.phtml">
                    <action method="setMethodFormTemplate"><method>purchaseorder</method><template>payment/form/purchaseorder.phtml</template></action>
                </block>
                <block type="core/template" name="checkout.onepage.payment.additional" as="additional" />
                <block type="core/template" name="checkout.onepage.payment.methods_additional" as="methods_additional" />
            </block>
            <block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="checkout/onepage/review.phtml"/>
        </block>
    </reference>
</checkout_onepage_index>

And put the following code in app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/onepage/progress.phtml

<div class="block block-progress opc-block-progress<?php if (!$this->isCustomerLoggedIn()/* && !$this->getCheckout()->getStepData('billing', 'is_show')*/): ?> opc-block-progress-step-login<?php endif; ?>">
<div class="block-title">
    <strong><span><?php echo $this->__('Your Checkout Progress') ?></span></strong>
</div>
<div class="block-content">
    <dl>
        <?php if ($this->getCheckout()->getStepData('billing', 'is_show')): ?>
        <div id="billing-progress-opcheckout">
            <?php echo $this->getChildHtml('billing.progress') ?>
        </div>
        <?php endif; ?>

        <?php if ($this->getCheckout()->getStepData('shipping', 'is_show')): ?>
        <div id="shipping-progress-opcheckout">
            <?php echo $this->getChildHtml('shipping.progress') ?>
        </div>
        <?php endif; ?>

        <?php if ($this->getCheckout()->getStepData('shipping_method', 'is_show')): ?>
        <div id="shipping_method-progress-opcheckout">
            <?php echo $this->getChildHtml('shippingmethod.progress') ?>
        </div>
        <?php endif; ?>

        <?php if ($this->getCheckout()->getStepData('payment', 'is_show')): ?>
        <div id="payment-progress-opcheckout">
            <?php echo $this->getChildHtml('payment.progress') ?>
        </div>
        <?php endif; ?>

    <?php echo $this->getChildHtml('coupon') ?>
    </dl>
</div>

You can see below screenshot for result:

enter image description here

Then clear cache and check.

  • Hi, both File Path are not Matched with our path, do we need to create that file if it is not available path shared by you – Neha Khedkar Apr 6 '18 at 11:39
  • Yes if that file is not in your theme then you need to create that file at above mentioned path. let me know if you want more detail help. – Chirag Rajput Apr 7 '18 at 5:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.