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

#   Set default product weight?

##

- **[FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")**
- [![FranksBank's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6002.png)](/forum/user/6002-franksbank "View FranksBank's Profile") Topic Author
- [ Offline](/forum/user/6002-franksbank)

Less More

- Posts: 21
- Thank you received: 0
-
-

14 years 6 months ago [\#47061](#47061) by [FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")  *[Set default product weight?](/forum/4-how-to/47061-set-default-product-weight#47061 "Quick question: Is it possible to set a default weight for all (new) products? I'm trying to streamline the process of entering new products for the user. All products weigh the same so I'd like that weight to be already specified when creating a new product, rather than the user having to set it every time (if they forget, the shipping doesn't work at checkout). It's not an important requirement; just a 'nice to have' if possible. So, possible? Cheers, Frank")* was created by *[FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")*

Quick question:
Is it possible to set a default weight for all (new) products?
I'm trying to streamline the process of entering new products for the user. All products weigh the same so I'd like that weight to be already specified when creating a new product, rather than the user having to set it every time (if they forget, the shipping doesn't work at checkout).
It's not an important requirement; just a 'nice to have' if possible.
So, possible?
Cheers,
Frank

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQ3MDYxLXNldC1kZWZhdWx0LXByb2R1Y3Qtd2VpZ2h0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) 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)
-

14 years 6 months ago -  14 years 6 months ago [\#47146](#47146) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Set default product weight?](/forum/4-how-to/47061-set-default-product-weight#47146 "Quick question: Is it possible to set a default weight for all (new) products? I'm trying to streamline the process of entering new products for the user. All products weigh the same so I'd like that weight to be already specified when creating a new product, rather than the user having to set it every time (if they forget, the shipping doesn't work at checkout). It's not an important requirement; just a 'nice to have' if possible. So, possible? Cheers, Frank")*

Hi FranksBank,

You can set a default value by editing the code.
Edit the file: YourSite/Administrator/component/com_hikashop/views/product/tmpl/common.php

And change the value of the product weight (l.48) from: Code:

value="&lt;?php echo @$this-&gt;element-&gt;product_weight;?&gt;"

To Code:

value="&lt;?php if(@$this-&gt;element-&gt;product_weight != "0.000"){echo @$this-&gt;element-&gt;product_weight;}else{echo "3.000";} ?&gt;"

Edit the value of "3.000" to what you want.

Last edit: 14 years 6 months ago by [Xavier](/forum/user/4105-xavier "View Xavier's Profile").

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

- **[FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")**
- [![FranksBank's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6002.png)](/forum/user/6002-franksbank "View FranksBank's Profile") Topic Author
- [ Offline](/forum/user/6002-franksbank)

Less More

- Posts: 21
- Thank you received: 0
-
-

14 years 6 months ago [\#47156](#47156) by [FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")  Replied by *[FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")* on topic *[Re: Set default product weight?](/forum/4-how-to/47061-set-default-product-weight#47156 "Quick question: Is it possible to set a default weight for all (new) products? I'm trying to streamline the process of entering new products for the user. All products weigh the same so I'd like that weight to be already specified when creating a new product, rather than the user having to set it every time (if they forget, the shipping doesn't work at checkout). It's not an important requirement; just a 'nice to have' if possible. So, possible? Cheers, Frank")*

Thanks Xavier. I made the change but now when I try to add a new product, the weight field is empty. What's even more odd, is that having reversed the change and put the original code/file back in place, it's still blank. Yoiks! Any ideas?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQ3MDYxLXNldC1kZWZhdWx0LXByb2R1Y3Qtd2VpZ2h0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) 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)
-

14 years 6 months ago [\#47161](#47161) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Set default product weight?](/forum/4-how-to/47061-set-default-product-weight#47161 "Quick question: Is it possible to set a default weight for all (new) products? I'm trying to streamline the process of entering new products for the user. All products weigh the same so I'd like that weight to be already specified when creating a new product, rather than the user having to set it every time (if they forget, the shipping doesn't work at checkout). It's not an important requirement; just a 'nice to have' if possible. So, possible? Cheers, Frank")*

By default the weight field is empty.

Try to change the value to: Code:

value="&lt;?php if($this-&gt;element-&gt;product_weight != null){echo @$this-&gt;element-&gt;product_weight;}else{echo "3.000";} ?&gt;"

The following user(s) said Thank You: [FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")

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

- **[FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")**
- [![FranksBank's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6002.png)](/forum/user/6002-franksbank "View FranksBank's Profile") Topic Author
- [ Offline](/forum/user/6002-franksbank)

Less More

- Posts: 21
- Thank you received: 0
-
-

14 years 6 months ago [\#47162](#47162) by [FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")  Replied by *[FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")* on topic *[Re: Set default product weight?](/forum/4-how-to/47061-set-default-product-weight#47162 "Quick question: Is it possible to set a default weight for all (new) products? I'm trying to streamline the process of entering new products for the user. All products weigh the same so I'd like that weight to be already specified when creating a new product, rather than the user having to set it every time (if they forget, the shipping doesn't work at checkout). It's not an important requirement; just a 'nice to have' if possible. So, possible? Cheers, Frank")*

Ahhh! Ok. My stupid fault/oversight. I've just had to go through an exercise of adding weights to 500 products, and got used to seeing "0.000" in the fields when I went in to amend. I forgot the field was blank for a new one. Sorry for that panic!

That new 'null' line works a treat. Thank you! ![:)](/media/kunena/emoticons/3.png ":)")

Do you happen to know if this can be done as an override (so I don't lose the setting of an upgrade comes in)? If so, what should the folder structure be within my template/html/?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQ3MDYxLXNldC1kZWZhdWx0LXByb2R1Y3Qtd2VpZ2h0P3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86359
- Thank you received: 14294
-
-

14 years 6 months ago [\#47178](#47178) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Set default product weight?](/forum/4-how-to/47061-set-default-product-weight#47178 "Quick question: Is it possible to set a default weight for all (new) products? I'm trying to streamline the process of entering new products for the user. All products weigh the same so I'd like that weight to be already specified when creating a new product, rather than the user having to set it every time (if they forget, the shipping doesn't work at checkout). It's not an important requirement; just a 'nice to have' if possible. So, possible? Cheers, Frank")*

You can edit the file "common" of the view "product" of your BACK END template via the menu Display-&gt;Views for that.

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

- **[FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")**
- [![FranksBank's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6002.png)](/forum/user/6002-franksbank "View FranksBank's Profile") Topic Author
- [ Offline](/forum/user/6002-franksbank)

Less More

- Posts: 21
- Thank you received: 0
-
-

14 years 6 months ago [\#47187](#47187) by [FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")  Replied by *[FranksBank](/forum/user/6002-franksbank "View FranksBank's Profile")* on topic *[Re: Set default product weight?](/forum/4-how-to/47061-set-default-product-weight#47187 "Quick question: Is it possible to set a default weight for all (new) products? I'm trying to streamline the process of entering new products for the user. All products weigh the same so I'd like that weight to be already specified when creating a new product, rather than the user having to set it every time (if they forget, the shipping doesn't work at checkout). It's not an important requirement; just a 'nice to have' if possible. So, possible? Cheers, Frank")*

Of course, yes. I should have had a look for it there.

Problem though. Adding the adjusted line there doesn't work. The code hint (see image below) suggests an issue with the double quotes (tried the _QQ_ workaround but doesn't fix it). Interestingly, the exact same code works if I remove the override and go back to adjusting/uploading the original file. If I then look at the replaced code through Display-&gt;Views (what it now thinks is its original) the same code hint is there but the value shows correctly for a new product. Something to do with any override being ignored owing to the code hint issue perhaps?

[ ![codehint&#95;defaultweightadjust.gif](/forum/attachment/3512) ](/forum/attachment/3512 "...ightadjust.gif")

I've left the 'amended original' in place for now as it works well. Would be great if the override worked; but not a major problem in the scheme of things.

- [ ![codehint&#95;defaultweightadjust.gif](/forum/attachment/3512) ](/forum/attachment/3512 "...ightadjust.gif") [ ](/forum/attachment/3512?download=1 "...ightadjust.gif")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQ3MDYxLXNldC1kZWZhdWx0LXByb2R1Y3Qtd2VpZ2h0P3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86359
- Thank you received: 14294
-
-

14 years 6 months ago [\#47372](#47372) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Set default product weight?](/forum/4-how-to/47061-set-default-product-weight#47372 "Quick question: Is it possible to set a default weight for all (new) products? I'm trying to streamline the process of entering new products for the user. All products weigh the same so I'd like that weight to be already specified when creating a new product, rather than the user having to set it every time (if they forget, the shipping doesn't work at checkout). It's not an important requirement; just a 'nice to have' if possible. So, possible? Cheers, Frank")*

You should add that code BEFORE the &lt;input tag.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQ3MDYxLXNldC1kZWZhdWx0LXByb2R1Y3Qtd2VpZ2h0P3RtcGw9bWFya2Rvd24=) 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.084 seconds

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