Perch Shop: Is there a better way to show shipping options?

  • I'm trying to find a better way to display the shipping options to the customer in a form with radio buttons.

    The label for each radio button will contain the standard shipping details sorted by cost (or at least priority):

    - Title
    - Description

    - Courier

    - Price

    Then have the form submit as the user so they don't have to keep pressing 'update shipping'

    Here is the shipping method template with radios (template borrowed from:…shipping-method-in-shop):


    1. perch_shop_shipping_method_form(['template' => 'shippings/method_form_radio.html']);

    HTML for method_form_radio.html

    My current attempt involves using a hidden set of options using perch_shop_shipping_options(); and using javascript to copy the content into the radiowrapper div within the form, this seems anything but ideal but kinda gets the job done.

    However I cannot seem to:

    A: Control the order of the options generated by 'shippings_list' - I would like to sort by cost, or at least priority?
    B: Get the form to submit when a radio is changed ($('#form1_shipping_method').submit(); does not work?).

    Is this possible?

  • If you want to use your own markup for a button, you'll need to add a CMS input type. This is to verify form.

    1. <perch:input type="cms">

    Otherwise you can change your button to a perch:input

    1. <perch:input type="submit" form="form1_shipping_method" value="Update shipping cost" class="update updateShipping"/>