Developing shipping plugin with own field

  • Posts: 37
  • Thank you received: 5
  • Hikashop Business
6 hours 10 minutes ago #365060

Hi,

I’m trying to develop shipping plugin. I want to add a text field that user can write some data. Then that data should be available in order details.
How to do it properly?

I am able to display field adding it like that. But how to save it in database in order?

function onShippingDisplay(&$order,&$methods,&$usable_methods,&$messages) {


foreach ($methods as $method) {
if ($method->shipping_type !== 'newpluginshipping') {
continue;
}

$method->shipping_name = 'My Shipping';
$method->shipping_description = 'More info.';

$html = '<div class="my-shipping-field">';
$html .= '<label for="my-shipping-field">Write detalis</label>';
$html .= '<input type="text" name="my-shipping-field" id=" my-shipping-field" value="" />';
$html .= '</div>';

$method->custom_html = $html;
$usable_methods[] = $method;


}
}

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum