Custom Shipping Form Fields Edited, Now Page Returns to Shipping Form Over & Over Again

I have modified template-functions.php started from line 498-565 onward to customize the delivery/shipping form for my region.

When testing the form 'live' - after entering the required fields for the form and i click 'continue checkout' the same form appears again instead of going to the next checkout page.

Below is the code I used - perhaps I did something wrong?

if (!$mp->download_only_cart($mp->get_cart_contents())) {
      $content .= '<tr>';
      $content .= '<td align="right">'. __('Full Name:', 'mp').'*</td><td>';
      $content .= apply_filters( 'mp_checkout_error_name', '' );
      $content .= '<input size="35" name="name" type="text" value="'.esc_attr($name).'" /> </td>';
      $content .= '</tr>';
      $content .= '<tr>';
      $content .= '<td align="right">'.__('Country:', 'mp').'*</td><td>';
      $content .= apply_filters( 'mp_checkout_error_country', '' );
      $content .= '<select id="mp_country" name="country">';
      foreach ((array)$settings['shipping']['allowed_countries'] as $code) {
        $content .= '<option value="'.$code.'"'.selected($country, $code, false).'>'.esc_attr($mp->countries[$code]).'</option>';
      }
      $content .= '</select>';
      $content .= '</td>';
      $content .= '</tr>';
      $content .= '<tr>';
	  $content .= '<td align="right">'.__('Area:', 'mp').'*</td><td>';
      $content .= apply_filters( 'mp_checkout_error_area', '' );
      $content .= '<input size="25" name="area" type="text" value="'.esc_attr($area).'" /></td>';
      $content .= '</tr>';
      $content .= '<tr>';
      $content .= '<td align="right">'. __('Block:', 'mp').'*</td><td>';
      $content .= apply_filters( 'mp_checkout_error_block', '' );
      $content .= '<input size="45" name="block" type="text" value="'.esc_attr($block).'" /><br />';
      $content .= '<small><em>'. __('', 'mp').'</em></small>';
      $content .= '</td>';
      $content .= '</tr>';
      $content .= '<tr>';
      $content .= '<td align="right">'. __('Street:', 'mp').'*</td><td>';
	  $content .= apply_filters( 'mp_checkout_error_street', '' );
      $content .= '<input size="45" name="street" type="text" value="'.esc_attr($street).'" /><br />';
      $content .= '<small><em>'.__('', 'mp').'</em></small>';
      $content .= '</td>';
      $content .= '</tr>';
      $content .= '<tr>';
	  $content .= '<td align="right">'. __('Judda:', 'mp').'</td><td>';
	  $content .= apply_filters( 'mp_checkout_error_judda', '' );
      $content .= '<input size="45" name="judda" type="text" value="'.esc_attr($judda).'" /><br />';
      $content .= '<small><em>'.__('', 'mp').'</em></small>';
      $content .= '</td>';
      $content .= '</tr>';
      $content .= '<tr>';
	  $content .= '<td align="right">'. __('Building Name:', 'mp').'</td><td>';
	  $content .= apply_filters( 'mp_checkout_error_building', '' );
      $content .= '<input size="45" name="building" type="text" value="'.esc_attr($building).'" /><br />';
      $content .= '<small><em>'.__('If delivery is to a flat or office, please enter the building name.', 'mp').'</em></small>';
      $content .= '</td>';
      $content .= '</tr>';
      $content .= '<tr>';
	  $content .= '<td align="right">'. __('Floor Number:', 'mp').'</td><td>';
	  $content .= apply_filters( 'mp_checkout_error_floor', '' );
      $content .= '<input size="45" name="floor" type="text" value="'.esc_attr($floor).'" /><br />';
      $content .= '<small><em>'.__('', 'mp').'</em></small>';
      $content .= '</td>';
      $content .= '</tr>';
      $content .= '<tr>';
	  $content .= '<td align="right">'. __('House or Flat Number:', 'mp').'*</td><td>';
	  $content .= apply_filters( 'mp_checkout_error_house', '' );
      $content .= '<input size="45" name="house" type="text" value="'.esc_attr($house).'" /><br />';
      $content .= '<small><em>'.__('Please enter your house number or flat number', 'mp').'</em></small>';
      $content .= '</td>';
      $content .= '</tr>';
      $content .= '<tr>';
      $content .= '<td align="right">'.__('Phone Number:', 'mp').'*</td><td>';
      $content .= '<input size="20" name="phone" type="text" value="'.esc_attr($phone).'" /></td>';
      $content .= '</tr>';
    }

I also tried 'force log-in' in store settings and that did not remedy the problem either.

Thanks!

  • Philip John
    • DEV MAN’s Apprentice

    Hiya!

    First off, you shouldn't edit the core code and to be honest, there's not much we can do to help you once you do so. Think of it as voiding the warranty!

    Instead, if you want to customise the shipping process you need to create your own shipping gateway.

    You can do so relatively easily by copying on of the existing gateways, renaming it and customising the code to suit your own requirements.

    Thanks,
    Phil

  • Mason
    • DEV MAN’s Sidekick

    Hiya,

    Just checking if it was eventually resolved in another thread? Or by yourself separately to us? Or by us over email with you? Or using our live support?

    If so, no need to reply, that's great news.

    If not, could you let us know by re-opening this topic, and we'll get onto it and helping you out asap!
    Otherwise, happy days, glad you got it sorted :slight_smile:

    Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.