Custom fields on discounts

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 5 months ago #20811

In discussions I might have a potential use for a custom field on the discounts table.

Could this be added to the wishlist please.

Might be worth considering where else custom fields could be added - shipping, payments, tax, taxation - not that I have a use at the moment.

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

  • Posts: 83019
  • Thank you received: 13401
  • MODERATOR
13 years 5 months ago #20822

Could you explain how that could be useful ? The discounts information is not displayed anywhere on the front end so I don't see how custom fields on them would be useful.

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

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 5 months ago #20861

This would just be for custom processing:

So instead of writing:

if ($discount->discount_code == 'DISC') dospecial(); else donormal();
could write:
if (@$discount->discount_isspecial) dospecial(); else donormal();

Another use just occurred to me - could use it to add a custom field containing text.
If field populated then it could be displayed in the custom views at checkout / in emails.

No immediate requirement for this, just an idea which came up in discussion.

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

  • Posts: 83019
  • Thank you received: 13401
  • MODERATOR
13 years 5 months ago #20875

If it's just for custom coding, I would prefer to not include it by default. As a coder, you could just create a new field in the table yourself and modify the file "form" of the view "discount" of the backend in order to add an input for the field. Then you could do what you want.
If you're a coder, that it quite trivial to do, and on our end it avoids cluttering HikaShop with stuff that almost no one uses.

You can already add custom fields of the type "custom text" in order to display text on the custom fields forms.

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

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 5 months ago #20891

That's OK.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum