How to Use Custom "Order" Field

  • Posts: 317
  • Thank you received: 20
  • Hikashop Business
8 years 9 months ago #231288

-- HikaShop version -- : 2.61
-- Joomla version -- : 3.45

The client would like to add a product automatically during checkout. The product allows customers to make an optional donation to the cause. I've tried several approaches, but none were ideal. Reading the forum, it appears that I can create a custom "Order" field. I can configure it to load my donation product. And then it should appear in the checkout screen, provided that I add the field to the sequence. It should become visible in the drag-and-drop fields at the top of the checkout configuration window.
First question: Am I correct?
Second question: Can I create two "Order" custom fields, one on top of the other? The first field would have a text message explaining the option to donate to the cause. The second field would contain the product for addition to the cart.
Thank you as always for the great system,
-Jim G.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 9 months ago #231323

Hi,

You can create two custom order fields yes. However, there is no system to have a custom order field add a product to the cart based on what you select in the field. This would require a custom plugin to be developed in order to do that action.

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

  • Posts: 317
  • Thank you received: 20
  • Hikashop Business
8 years 9 months ago #231367

Thank you. I think I should have been more clear. What we want to do: simply display this optional product via an order field. The customer would still have to manually add to cart. It is an optional additional purchase which we want to display. Almost like a related product. You might think of this as a related product for ALL products in the entire store.
-Jim Gribble

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 9 months ago #231371

Hi,

In that case, you could use a product content tag in order to add a tag in the custom field (of the type "custom text") to display the product on the checkout.
www.hikashop.com/support/documentation/1...-product-insert.html
You'll have one limit though: you can't display the add to cart button directly on the checkout, only a link to the product page. Becuase otherwise, you would have a form (the add to cart form) in a form (the checkout page form), and it's not possible in HTML to have forms into forms and thus it wouldn't work properly.

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

  • Posts: 317
  • Thank you received: 20
  • Hikashop Business
8 years 9 months ago #231472

So, if I understand, the basic format is something like this: {product}1|name|pricedis3|pricetax1{/product} And I would insert it into the custom text field?
Seems clear enough, but in the documentation what is the purpose of the numeral 1? I see that that the fieldnames are separated by simple vertical slashes. Why is that numeral 1 there? What does it do?
Thank you,
-Jim G.

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

  • Posts: 317
  • Thank you received: 20
  • Hikashop Business
8 years 9 months ago #231477

Thanks, now I see and understand how it works. When you add a product, instead of being based on product name, it uses the product number which is assigned automatically. I can see how this will be very handy. (I was expecting to see product name show up in the code.)
-Jim Gribble

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

  • Posts: 317
  • Thank you received: 20
  • Hikashop Business
8 years 8 months ago #232892

So, I seem to have solved my problem with a custom text field assigned to all my product categories. On checkout, the custom field appears just before "finish." Which is perfect. Maybe you should explain in documentation is that this is an HTML field which can be coded in a variety of ways. I added a graphic for example via external URL; and a hyperlink to my "donate" product. There's is only one thing I'm unhappy about: position of the custom field label off to the left side of the custom text. It looks like a mistake. I would like to have it on top of even not show it. There is no such option in the control screen, and it's very difficult to see the CSS code that's driving this alignment. It seems to be a form label and to change that CSS could change many other things haphazardly. I am attaching a screen shot and asking your advice.
Thanks again,
-Jim Gribble

Attachments:

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

  • Posts: 317
  • Thank you received: 20
  • Hikashop Business
8 years 8 months ago #232893

Never mind; I just discovered that the label is optional. I left it blank and it doesn't show and the form looks fine. Always something new to discover.

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

Time to create page: 0.062 seconds
Powered by Kunena Forum