- Posts: 101
- Thank you received: 12
[solved]order custom field to simulate shipment
13 years 7 months ago - 13 years 7 months ago #91176
by SG
[solved]order custom field to simulate shipment was created by SG
Hi,
For the shipment the client wants to show three states:
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:
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
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
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
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:
- we are not mandatory to use weight in products since we don't use it anyway. Otherwise the shipment plugin isn't shown
- 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
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
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: 13 years 7 months ago by SG.
Please Log in or Create an account to join the conversation.
13 years 7 months ago - 13 years 7 months ago #91230
by SG
Replied by SG on topic order custom field to simulate shipment
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:
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.
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:
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: 13 years 7 months ago by SG.
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
13 years 7 months ago #91403
by nicolas
Replied by nicolas on topic order custom field to simulate shipment
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.
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.220 seconds