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

#   Adding Product Weight to Checkout Cart/Order

##

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

Less More

- Posts: 40
- Thank you received: 0
-
-

13 years 9 months ago [\#88389](#88389) by [cluckngood](/forum/user/11050-cluckngood "View cluckngood's Profile")  *[Adding Product Weight to Checkout Cart/Order](/forum/2-general-talk-about-hikashop/78010-adding-product-weight-to-checkout-cart-order#88389 "Is there a way to add the Product Weight to the Order Cart during checkout? I have many products with the same name that are differentiated by size. Aside from the price there is currently no way to...")* was created by *[cluckngood](/forum/user/11050-cluckngood "View cluckngood's Profile")*

Is there a way to add the Product Weight to the Order Cart during checkout? I have many products with the same name that are differentiated by size. Aside from the price there is currently no way to easily see specifically which size product the customer has ordered on the order email i receive.

Does anyone know of how to modify the code so the product weight is displayed in the cart?

Jason

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4MDEwLWFkZGluZy1wcm9kdWN0LXdlaWdodC10by1jaGVja291dC1jYXJ0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 8 months ago [\#88547](#88547) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Adding Product Weight to Checkout Cart/Order](/forum/2-general-talk-about-hikashop/78010-adding-product-weight-to-checkout-cart-order#88547 "Is there a way to add the Product Weight to the Order Cart during checkout? I have many products with the same name that are differentiated by size. Aside from the price there is currently no way to...")*

To add the weight in the cart of the checkout, you have to edit the view "checkout / cart" and then add a column for the weight.
The variable to use for the price is "$row-&gt;product_weight".

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4MDEwLWFkZGluZy1wcm9kdWN0LXdlaWdodC10by1jaGVja291dC1jYXJ0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 40
- Thank you received: 0
-
-

13 years 8 months ago [\#88716](#88716) by [cluckngood](/forum/user/11050-cluckngood "View cluckngood's Profile")  Replied by *[cluckngood](/forum/user/11050-cluckngood "View cluckngood's Profile")* on topic *[Adding Product Weight to Checkout Cart/Order](/forum/2-general-talk-about-hikashop/78010-adding-product-weight-to-checkout-cart-order#88716 "Is there a way to add the Product Weight to the Order Cart during checkout? I have many products with the same name that are differentiated by size. Aside from the price there is currently no way to...")*

Thank you for this. I was able to get the weight to appear, however my PHP is pretty weak and i can't seem to figure out how to get a new column to appear with the title "Weight" and the product weight under the column.

I was only able to get the weight directly beside the product name. Is there an example i can view somewhere that i can copy/paste the code i need to do this?

Jason

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4MDEwLWFkZGluZy1wcm9kdWN0LXdlaWdodC10by1jaGVja291dC1jYXJ0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 8 months ago [\#88811](#88811) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Adding Product Weight to Checkout Cart/Order](/forum/2-general-talk-about-hikashop/78010-adding-product-weight-to-checkout-cart-order#88811 "Is there a way to add the Product Weight to the Order Cart during checkout? I have many products with the same name that are differentiated by size. Aside from the price there is currently no way to...")*

It's not really PHP knowledge that are neede here, but HTML.
In the &lt;thead&gt; tag, you can add: Code:

&lt;th id="hikashop_cart_product_weight_title" class="hikashop_cart_product_weight_title hikashop_cart_title"&gt; &lt;?php echo JText::_('CART_PRODUCT_WEIGHT'); ?&gt; &lt;/th&gt;

after: Code:

&lt;th id="hikashop_cart_product_name_title" class="hikashop_cart_product_name_title hikashop_cart_title"&gt; &lt;?php echo JText::_('CART_PRODUCT_NAME'); ?&gt; &lt;/th&gt;

And in the &lt;tbody&gt;, add: Code:

&lt;td class="hikashop_cart_product_weight_value"&gt; &lt;?php echo $row-&gt;product_weight; ?&gt; &lt;/td&gt;

Before: Code:

&lt;td class="hikashop_cart_product_price_value"&gt;

The following user(s) said Thank You: [cluckngood](/forum/user/11050-cluckngood "View cluckngood's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4MDEwLWFkZGluZy1wcm9kdWN0LXdlaWdodC10by1jaGVja291dC1jYXJ0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 40
- Thank you received: 0
-
-

13 years 8 months ago [\#88908](#88908) by [cluckngood](/forum/user/11050-cluckngood "View cluckngood's Profile")  Replied by *[cluckngood](/forum/user/11050-cluckngood "View cluckngood's Profile")* on topic *[Adding Product Weight to Checkout Cart/Order](/forum/2-general-talk-about-hikashop/78010-adding-product-weight-to-checkout-cart-order#88908 "Is there a way to add the Product Weight to the Order Cart during checkout? I have many products with the same name that are differentiated by size. Aside from the price there is currently no way to...")*

This worked perfectly. Next step is to get the weight to also display in the User &amp; Admin Order Confirmation Emails. I was able to get the title to publish in the email, however the weight value won't work. Something must be different for the email than the cart. I've tried adding the code

&lt;td&gt; &lt;p class="hikashop_cart_product_weight_value"&gt;
&lt;?php echo $row-&gt;product_weight; ?&gt;
&lt;/p&gt;&lt;/td&gt;

…but it doesn't pull the weight value into the email. I only get a blank cell. Is there a mod that needs to be applied to this to get it to work?

Jason

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4MDEwLWFkZGluZy1wcm9kdWN0LXdlaWdodC10by1jaGVja291dC1jYXJ0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 8 months ago [\#88977](#88977) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Adding Product Weight to Checkout Cart/Order](/forum/2-general-talk-about-hikashop/78010-adding-product-weight-to-checkout-cart-order#88977 "Is there a way to add the Product Weight to the Order Cart during checkout? I have many products with the same name that are differentiated by size. Aside from the price there is currently no way to...")*

You should try with "$item-&gt;order_product_weight" instead of "$row-&gt;product_weight"

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4MDEwLWFkZGluZy1wcm9kdWN0LXdlaWdodC10by1jaGVja291dC1jYXJ0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

13 years 8 months ago [\#89101](#89101) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding Product Weight to Checkout Cart/Order](/forum/2-general-talk-about-hikashop/78010-adding-product-weight-to-checkout-cart-order#89101 "Is there a way to add the Product Weight to the Order Cart during checkout? I have many products with the same name that are differentiated by size. Aside from the price there is currently no way to...")*

It's not possible to use either "$item-&gt;order_product_weight" or "$row-&gt;product_weight" in emails as the product_weight data is simply not there.
You will need to first load the data from the database. So the code should be: Code:

&lt;?php $productClass = hikashop_get('class.product'); $product = $productClass-&gt;get($item-&gt;product_id); echo $product-&gt;product_weight; ?&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4MDEwLWFkZGluZy1wcm9kdWN0LXdlaWdodC10by1jaGVja291dC1jYXJ0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 40
- Thank you received: 0
-
-

13 years 8 months ago [\#91525](#91525) by [cluckngood](/forum/user/11050-cluckngood "View cluckngood's Profile")  Replied by *[cluckngood](/forum/user/11050-cluckngood "View cluckngood's Profile")* on topic *[Adding Product Weight to Checkout Cart/Order](/forum/2-general-talk-about-hikashop/78010-adding-product-weight-to-checkout-cart-order#91525 "Is there a way to add the Product Weight to the Order Cart during checkout? I have many products with the same name that are differentiated by size. Aside from the price there is currently no way to...")*

Thanks for the code. I've inserted it into the file located at "/media/com_hikashop/email/order_admin_notification.html.php" and am still having the product id show up.

The code for the User Order Confirmation has different code. I also tried inserting the supplied code in place for the file "/media/com_hikashop/email/order_admin_notification.html.php" and the shopping cart stopped working. It began loading a blank page at the end and wouldn't complete the order checkout. the code i have in place now is:

&lt;?php } ?&gt;
&lt;!-- Product Weight Value Begins --&gt;
&lt;td&gt;&lt;p class="hikashop_cart_product_weight_value" style="text-align: center;"&gt;
&lt;?php echo $item-&gt;order_product_weight; ?&gt; &lt;/p&gt;&lt;/td&gt;
&lt;!-- Product Weight Value Ends --&gt;

I have attached these two pages for a complete reference. I'm not very familiar with PHP but am sure it is a very simple item that i am missing to correct this. Any idea what I am doing wrong?

Jason

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4MDEwLWFkZGluZy1wcm9kdWN0LXdlaWdodC10by1jaGVja291dC1jYXJ0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 8 months ago [\#91671](#91671) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Adding Product Weight to Checkout Cart/Order](/forum/2-general-talk-about-hikashop/78010-adding-product-weight-to-checkout-cart-order#91671 "Is there a way to add the Product Weight to the Order Cart during checkout? I have many products with the same name that are differentiated by size. Aside from the price there is currently no way to...")*

Hi,

Thanks to try with the following files:

*This attachment is hidden for guests.
Please log in or register to see it.*

*This attachment is hidden for guests.
Please log in or register to see it.*

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4MDEwLWFkZGluZy1wcm9kdWN0LXdlaWdodC10by1jaGVja291dC1jYXJ0LW9yZGVyP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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.106 seconds

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