Forum

Thread tagged as: Question, Error, Shop

Shipping Method Form button value wrong

Hello, The perch_shop_shipping_method_form function is writing the button value incorrectly using the value for the previous perch_shop_order_address_form function by the looks of it.

Code on my checkout page:

<?php
    if (perch_shop_addresses_set()) {
        perch_shop_order_addresses();
    } else {
        perch_shop_order_address_form();
    }
    if (perch_shop_addresses_set()) {
        perch_shop_shipping_method_form([ 'template' => 'shippings/method_form.html' ]);
?>
<div class="cart-box cart-box-focus">
<?php
        perch_shop_cart(['template' => 'cart/cart_total_checkout.html']);
        perch_shop_form('checkout/confirm.html');
?>
</div>
<?php
    }
?>

method_form.html:

<perch:form id="shipping_method" method="post" app="perch_shop">
<div class="cart-box">
    <h2>Shipping method</h2>

    <perch:error for="all" type="login">
        <p class="error">Sorry, there was a problem.</p>
    </perch:error>

    <div class="form-row">
        <perch:input type="select" options="<perch:shop id="shippings_list" />" id="shipping" required="true" placeholder="Please choose"  />
        <perch:error for="shipping" type="required">Required</perch:error>
    </div>
    <div class="form-action">
        <perch:input type="submit" id="submit" class="button" value="Set Shipping Method" />
        <perch:input type="hidden" id="r" />
    </div>
</div>
</perch:form>

The button text show on the page is "Set/Edit Addresses" which is used on the order_address_form.html template.

Diagnostic Report:

Perch Runway: 2.8.32, PHP: 5.6.10, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_forms (1.8.3), perch_shop_orders (1.0.9), perch_shop_products (1.0.9), perch_shop (1.0.9), perch_members (1.5)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'perch_blog', 'perch_members', 'perch_shop', );
PERCH_LOGINPATH: /tt_admin
PERCH_PATH: /Users/bradhardinge/Documents/thethinktree/thethinktree/site/production/tt_admin
PERCH_CORE: /Users/bradhardinge/Documents/thethinktree/thethinktree/site/production/tt_admin/core
PERCH_RESFILEPATH: /Users/bradhardinge/Documents/thethinktree/thethinktree/site/production/tt_admin/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: thethinktree.dev
DOCUMENT_ROOT: /Users/bradhardinge/Documents/thethinktree/thethinktree/site/production
REQUEST_URI: /tt_admin/core/settings/diagnostics/
SCRIPT_NAME: /tt_admin/core/settings/diagnostics/index.php

As a temp measure, I've just made all the button values "Update" to hack it.

Brad Hardinge

Brad Hardinge 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

If the buttons have the same ID, then the value will be prefilled. You can either change the ID or turn of the prefill.