How to add items numbering in cart

  • Posts: 174
  • Thank you received: 2
  • Hikashop Business
6 years 8 months ago #289120

How can i add numbering of items in cart? 1,2,3,4... as much items
And i need to show these numbers in emails and order detail page.

Actually i need some number/code which identifies the order and item, for example i have 4 items in order. So if i get code A4C2B3-3, i will know the order number and which item.

i also thought about adding custom item field which will automatically generate some code after each item is added to cart, but haven't found such field type.

If it can't be done without coding, which versions will be the easiest for programmer?

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
6 years 8 months ago #289121

Hi,

That will indeed require custom coding.
If you want to rely on a custom item field to store the code for each product in the cart/order, you'll need the Business edition.

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

  • Posts: 174
  • Thank you received: 2
  • Hikashop Business
6 years 8 months ago #289159

as you can see on left side of this forum - i have Business edition, long long time now.
So you recommend as easiest way to do that is to code some plugin which will add new custom field type?

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
6 years 8 months ago #289178

Hi,

No, I would create a normal custom item field of the type text in the interface.
But I would add a plugin implementing the onAfterOrderCreate trigger to update the value of the custom field in the hikashop_order_product table using the order_number of the order and the id you'll generate to store that for each product when the order is created.
Then, you can just activate the display settings of the custom item field to have the value display for each product in the different areas.

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

Time to create page: 0.061 seconds
Powered by Kunena Forum