3

please anyone suggest me how to auto select shipping method from paypal review page to review order page

In detail:

Basically, as customer order some product then he click on paypal checkout then after customer give paypal details and after that it redirects to paypal review Information page then after it redirects to my website www.example.com/paypal/express/review page where customer again select shipping method if he didn't select he is unable to place order as place order button was disabled enter image description hereenter image description here

4
  • there is a option to skip the review in paypal payment method settings
    – Anton S
    Commented Apr 27, 2016 at 12:32
  • i don't want to skip this page i want review page and in that i only want to auto select shipping method from paypal review information page Commented Apr 27, 2016 at 12:36
  • extend and develop a solution for auto-select then , only way out
    – Anton S
    Commented Apr 27, 2016 at 12:58
  • Moreover it selects automatically shipping method in second time when customer click on edit shipping address or any other tab Commented Apr 27, 2016 at 13:02

1 Answer 1

0

You can copy the template default/template/paypal/express/review.phtml to your theme and modify it.

1. To just preselect a shipping method add at the end of the file:

<script type="text/javascript">
    //<![CDATA[
    jQuery("#shipping_method").val('flatrate_flatrate');
    //]]>
</script>

Where 'flatrate_flatrate' is the shipping method value you want to preselect

2. Tell the customer to select a shipping method [better solution]

In my opinion a better solution is to tell the customer to select a shipping method.

Add a little hint above the "Place Order" button

<div id="missing_shipping_method" style="display:none; padding: 5px; color: #ff0000; float:right;">
    Please select a shipping method.
</div>

Add a little javascript snippet at the very end of the review.phtml to control the hint box and add/remove a red border from the select box

<script type="text/javascript">
    //<![CDATA[
    jQuery('#shipping_method').change(function() {
        if (jQuery("#shipping_method").val() === "") {
            jQuery("#missing_shipping_method").show();
            jQuery("#shipping_method").css({
                'border': '2px solid',
                'border-color': '#ff0000'
            });
        } else {
            jQuery('#missing_shipping_method').hide();
            jQuery("#shipping_method").css({
                'border': '0px'
            });
        }
    });

    jQuery(document).ready(function() {
        jQuery('#shipping_method').trigger('change');
    });
    //]]>
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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