[solved]order custom field to simulate shipment

  • Posts: 101
  • Thank you received: 12
11 years 9 months ago #91176

Hi,

For the shipment the client wants to show three states:

  • Normal
  • Urgent
  • Self Pickup (give comment on which date and hour in a textarea field
When the last one is chosen "Self Pickup" a text area field should be displayed where the customer can tell when he'd like to pickup his order.

Since we are not going to use prices for the shipment, I thought I would use a custom field.

I made two custom fields:
First one of the type RADIO called "ShipmentMethods" and has the tree values: Normal, Urgent and Self Pickup.
A second field "CommentShipment"of the type TEXTARE and used "Display limited to" "ShipmentMethods" and last value "Self Pickup".

The reasons we do it this way are because:
  1. we are not mandatory to use weight in products since we don't use it anyway. Otherwise the shipment plugin isn't shown
  2. we can add a comment field for additional info about the self pickup date and time

Everything seems to be working but I have two questions :-)

1) Is this a good approach? Do you think I have to watch out for something or any other advice?


EDIT: I answered question 2 myself :-) but any remarks are welcome!
2) Is it possible to display the chosen values in from both custom fields in the STATUS?
Because I like the way it's says

You chose the shipping method: Self Pickup

[/color]
I know I could just drag FIELDS in the checkout workflow but I'd rather show a read only text just like the hika shipment plugin.



Thanks

Last edit: 11 years 9 months ago by SG.

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

  • Posts: 101
  • Thank you received: 12
11 years 9 months ago #91230

Hi,

The more I use HikaShop, the more I like it :-)

For question 2 I found how to do it.
I had to go to Display -> Views and the open checkout / status.php
There I added the following code:

if(!empty($this->order->ShipmentMethods)){
     if(!empty($this->order->CommentShipment)){
       $array[]= JText::sprintf('HIKASHOP_SHIPPING_METHOD_CHOSEN', '<span class="label label-info"> '.$this->order->ShipmentMethods.':  '.$this->order->CommentShipment.'</span>');
     }
     else{
       $array[]= JText::sprintf('HIKASHOP_SHIPPING_METHOD_CHOSEN', '<span class="label label-info"> '.$this->order->ShipmentMethods.'</span>');
     }
  }

This might be interesting for anyone who wants to add their own custom field in a read-only mode in the status.

So I guess I'm just wondering about question 1 if it has any disadvantage that you can think of by using a custom shipment field like I did.

Thanks.

Last edit: 11 years 9 months ago by SG.
The following user(s) said Thank You: nicolas

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 9 months ago #91403

Hi,

That's indeed a good approach for your use case. And the code you used is the way to go.
I would have done the same.

The following user(s) said Thank You: SG

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

Time to create page: 0.058 seconds
Powered by Kunena Forum