Custom Field On Checkout Page

  • Posts: 964
  • Thank you received: 11
  • Hikashop Business
11 years 6 months ago #98851

I need some guidance please and thank you.

I created a "note_to_seller" field in the "order" table. It's showing after the products on the checkout page. I would like to show it at the very bottom of the checkout page but I'm not sure what template to put it in so it's at the bottom? I added it to the orders table but I'm not even sure if that's the correct table.

Thanks!!

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

  • Posts: 82761
  • Thank you received: 13348
  • MODERATOR
11 years 6 months ago #98866

You can drag & drop the "fields" view at the bottom in the checkout workflow option of the configuration in order to do that. No template to edit.

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

  • Posts: 964
  • Thank you received: 11
  • Hikashop Business
11 years 6 months ago #98871

Oh man... you wouldn't believe how much time I spent trying to figure this out :)

Thanks!!

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

  • Posts: 964
  • Thank you received: 11
  • Hikashop Business
11 years 6 months ago #98873

Sorry one more question.

I'm trying to style the "note to seller" section so that I don't miss the note, if there's one, when I get the email. I looked through the "Order Creation Notification" and "Order administrator notification" but I don't see where the "note to seller" field is. I would like to style them in both emails.

Thanks!!

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

  • Posts: 82761
  • Thank you received: 13348
  • MODERATOR
11 years 6 months ago #99062

The custom order fields are added automatically in the email with this code

<td><?php
				$fields = $fieldsClass->getFields('frontcomp',$data,'order','');
				foreach($fields as $fieldName => $oneExtraField) {
					if(empty($data->$fieldName)) continue;
					echo "<br/>".$fieldsClass->trans($oneExtraField->field_realname).' : '.$fieldsClass->show($oneExtraField,$data->$fieldName);
				} ?></td>

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

  • Posts: 31
  • Thank you received: 0
11 years 6 months ago #99150

Hi,
I see what you are saying here but I dont really understand the workflow and how the fields are added. Is the flow horizontal or vertical? when viewed on the page. What does it mean to the layout when a workflow is a added next to another. Sorry the process does not give me a result I can understand when published.

Regards,


Brian

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

  • Posts: 82761
  • Thank you received: 13348
  • MODERATOR
11 years 6 months ago #99180

It's both vertical and horizontal.

By default, you have all the views on the same step. So they are all "vertical".
If you put them all horizontally, you will have one view per step.

Here is more information on that option:
www.hikashop.com/en/support/documentatio...ml#checkout_checkout

The following user(s) said Thank You: briand

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

  • Posts: 964
  • Thank you received: 11
  • Hikashop Business
11 years 6 months ago #99259

Thank you nicolas. I was able to style the one that goes to the customer but not sure how to style the one that goes to the seller. I add <br> and <b> in the code but it's giving me errors.

Can you give me some direction. I think this is the correct code:

$fieldsClass = hikashop_get('class.field');
          $fields = $fieldsClass->getFields('frontcomp',$data,'order','');
          foreach($fields as $fieldName => $oneExtraField) {
            $fieldData = trim(@$data->$fieldName);
            if(empty($fieldData)) continue;
            echo "<br/>".$fieldsClass->trans($oneExtraField->field_realname).' : '.$fieldsClass->show($oneExtraField,$data->$fieldName);
          }

Thanks!!

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

  • Posts: 82761
  • Thank you received: 13348
  • MODERATOR
11 years 6 months ago #99454

What error ?
What modification did you do ?

Hard to say what to do without any information :/

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

  • Posts: 964
  • Thank you received: 11
  • Hikashop Business
11 years 6 months ago #99765

When I get the ADMIN email there is no space between the information - so it looks all jumbled. I add a <br> just above the code shown above but I am getting errors as I assume I am placing it in the incorrect spot (I removed it before I posted the code).

What I was trying to do is add a span around the "Custom Field" info but I don't know where to add the span.

Hope this is clearer. Thanks!!

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

  • Posts: 82761
  • Thank you received: 13348
  • MODERATOR
11 years 6 months ago #100012

You can do like that:

$fieldsClass = hikashop_get('class.field');
          $fields = $fieldsClass->getFields('frontcomp',$data,'order','');
          foreach($fields as $fieldName => $oneExtraField) {
            $fieldData = trim(@$data->$fieldName);
            if(empty($fieldData)) continue;
            echo "<span><br/>".$fieldsClass->trans($oneExtraField->field_realname).' : '.$fieldsClass->show($oneExtraField,$data->$fieldName).'</span>';
          }

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

Time to create page: 0.082 seconds
Powered by Kunena Forum