[Skip to main content](#vessel-content)

#   Can i change the custom field data type to numeric

##

- **[hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")**
- [![hexcodc's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39903-hexcodc "View hexcodc's Profile") Topic Author
- [ Offline](/forum/user/39903-hexcodc)

Less More

- Posts: 42
- Thank you received: 0
-
-

10 years 9 months ago [\#228080](#228080) by [hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")  *[Can i change the custom field data type to numeric](/forum/32-content-creation/881943-can-i-change-the-custom-field-data-type-to-numeric#228080 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.8.4 -- PHP version -- : 5.5.30  Hi, I have a question. is there a way I can create a custom field type currently TEXT to numeric so I can add the numbers up. I know that I can change it directly through the database, if it is the only way to do so, which tables should I update assuming I am working on the product table.  Thanks,  Gary")* was created by *[hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")*

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.8.4
-- PHP version -- : 5.5.30

Hi, I have a question. is there a way I can create a custom field type currently TEXT to numeric so I can add the numbers up. I know that I can change it directly through the database, if it is the only way to do so, which tables should I update assuming I am working on the product table.

Thanks,

Gary

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODgxOTQzLWNhbi1pLWNoYW5nZS10aGUtY3VzdG9tLWZpZWxkLWRhdGEtdHlwZS10by1udW1lcmljP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")**
- [![hexcodc's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39903-hexcodc "View hexcodc's Profile") Topic Author
- [ Offline](/forum/user/39903-hexcodc)

Less More

- Posts: 42
- Thank you received: 0
-
-

10 years 9 months ago [\#228081](#228081) by [hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")  Replied by *[hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")* on topic *[Can i change the custom field data type to numeric](/forum/32-content-creation/881943-can-i-change-the-custom-field-data-type-to-numeric#228081 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.8.4 -- PHP version -- : 5.5.30  Hi, I have a question. is there a way I can create a custom field type currently TEXT to numeric so I can add the numbers up. I know that I can change it directly through the database, if it is the only way to do so, which tables should I update assuming I am working on the product table.  Thanks,  Gary")*

The reason I want is that I want to show travel points for each product using the custom field, each product has different points. I want to have the total points added up and shown to the user during checkout. Can alphauserpoints do the tricks?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODgxOTQzLWNhbi1pLWNoYW5nZS10aGUtY3VzdG9tLWZpZWxkLWRhdGEtdHlwZS10by1udW1lcmljP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

10 years 9 months ago [\#228091](#228091) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Can i change the custom field data type to numeric](/forum/32-content-creation/881943-can-i-change-the-custom-field-data-type-to-numeric#228091 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.8.4 -- PHP version -- : 5.5.30  Hi, I have a question. is there a way I can create a custom field type currently TEXT to numeric so I can add the numbers up. I know that I can change it directly through the database, if it is the only way to do so, which tables should I update assuming I am working on the product table.  Thanks,  Gary")*

Hi,

No, AUP won't help you.
You need to create a custom field of the type "product" via the menu Display&gt;Custom field.
That will allow you to enter the points for each product in the product edition page of the backend (or in the database).
Then, to display the total of the points of the products in the cart on the checkout, you'll have to customize the file "cart" of the view "checkout" via the menu Display&gt;Views in order to add custom code to do the sum and then display it there.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODgxOTQzLWNhbi1pLWNoYW5nZS10aGUtY3VzdG9tLWZpZWxkLWRhdGEtdHlwZS10by1udW1lcmljP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")**
- [![hexcodc's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39903-hexcodc "View hexcodc's Profile") Topic Author
- [ Offline](/forum/user/39903-hexcodc)

Less More

- Posts: 42
- Thank you received: 0
-
-

10 years 9 months ago [\#228224](#228224) by [hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")  Replied by *[hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")* on topic *[Can i change the custom field data type to numeric](/forum/32-content-creation/881943-can-i-change-the-custom-field-data-type-to-numeric#228224 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.8.4 -- PHP version -- : 5.5.30  Hi, I have a question. is there a way I can create a custom field type currently TEXT to numeric so I can add the numbers up. I know that I can change it directly through the database, if it is the only way to do so, which tables should I update assuming I am working on the product table.  Thanks,  Gary")*

Thank you, can you show me the code to display product custom field on checkout?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODgxOTQzLWNhbi1pLWNoYW5nZS10aGUtY3VzdG9tLWZpZWxkLWRhdGEtdHlwZS10by1udW1lcmljP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

10 years 9 months ago [\#228237](#228237) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Can i change the custom field data type to numeric](/forum/32-content-creation/881943-can-i-change-the-custom-field-data-type-to-numeric#228237 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.8.4 -- PHP version -- : 5.5.30  Hi, I have a question. is there a way I can create a custom field type currently TEXT to numeric so I can add the numbers up. I know that I can change it directly through the database, if it is the only way to do so, which tables should I update assuming I am working on the product table.  Thanks,  Gary")*

Hi,

Well, in the cart file of the checkout view, you can use such code:
echo $row-&gt;field_column_name;

where field_column_name is to be replaced with the column name of the custom field.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODgxOTQzLWNhbi1pLWNoYW5nZS10aGUtY3VzdG9tLWZpZWxkLWRhdGEtdHlwZS10by1udW1lcmljP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")**
- [![hexcodc's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39903-hexcodc "View hexcodc's Profile") Topic Author
- [ Offline](/forum/user/39903-hexcodc)

Less More

- Posts: 42
- Thank you received: 0
-
-

10 years 9 months ago [\#228817](#228817) by [hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")  Replied by *[hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")* on topic *[Can i change the custom field data type to numeric](/forum/32-content-creation/881943-can-i-change-the-custom-field-data-type-to-numeric#228817 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.8.4 -- PHP version -- : 5.5.30  Hi, I have a question. is there a way I can create a custom field type currently TEXT to numeric so I can add the numbers up. I know that I can change it directly through the database, if it is the only way to do so, which tables should I update assuming I am working on the product table.  Thanks,  Gary")*

Hi Nicolas,

Thank you for your reply. I have managed to create a custom field (travel point) for the item table as the picture attachment. Now my question is that can you show me the code so that i can add the points together and display the total in the checkout.

Product1 (points x quality) + Product2 (points x qualty) = Total Points

Regards,

Gary

- [ ![hikauser&#95;point&#95;5.jpg](/forum/attachment/29319) ](/forum/attachment/29319 "...er&#95;point&#95;5.jpg") [ ](/forum/attachment/29319?download=1 "...er&#95;point&#95;5.jpg")
- [ ![hikauser&#95;point&#95;6.jpg](/forum/attachment/29320) ](/forum/attachment/29320 "...er&#95;point&#95;6.jpg") [ ](/forum/attachment/29320?download=1 "...er&#95;point&#95;6.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODgxOTQzLWNhbi1pLWNoYW5nZS10aGUtY3VzdG9tLWZpZWxkLWRhdGEtdHlwZS10by1udW1lcmljP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

10 years 9 months ago -  10 years 9 months ago [\#228824](#228824) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Can i change the custom field data type to numeric](/forum/32-content-creation/881943-can-i-change-the-custom-field-data-type-to-numeric#228824 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.8.4 -- PHP version -- : 5.5.30  Hi, I have a question. is there a way I can create a custom field type currently TEXT to numeric so I can add the numbers up. I know that I can change it directly through the database, if it is the only way to do so, which tables should I update assuming I am working on the product table.  Thanks,  Gary")*

Hi,

Well, there is nothing complex:
Before the foreach displaying each product in the cart view file:
$total_points = 0;

Then, in the foreach:
$total_points+= $row-&gt;travel_points*$row-&gt;cart_product_quantity;

And after the foreach:
echo $total_points;

Last edit: 10 years 9 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODgxOTQzLWNhbi1pLWNoYW5nZS10aGUtY3VzdG9tLWZpZWxkLWRhdGEtdHlwZS10by1udW1lcmljP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")**
- [![hexcodc's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39903-hexcodc "View hexcodc's Profile") Topic Author
- [ Offline](/forum/user/39903-hexcodc)

Less More

- Posts: 42
- Thank you received: 0
-
-

10 years 9 months ago [\#229073](#229073) by [hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")  Replied by *[hexcodc](/forum/user/39903-hexcodc "View hexcodc's Profile")* on topic *[Can i change the custom field data type to numeric](/forum/32-content-creation/881943-can-i-change-the-custom-field-data-type-to-numeric#229073 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.8.4 -- PHP version -- : 5.5.30  Hi, I have a question. is there a way I can create a custom field type currently TEXT to numeric so I can add the numbers up. I know that I can change it directly through the database, if it is the only way to do so, which tables should I update assuming I am working on the product table.  Thanks,  Gary")*

thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODgxOTQzLWNhbi1pLWNoYW5nZS10aGUtY3VzdG9tLWZpZWxkLWRhdGEtdHlwZS10by1udW1lcmljP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.078 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
