Changing defaut weight from kg to g

  • Posts: 299
  • Thank you received: 2
10 years 3 months ago #140020

-- url of the page with the problem -- : www.gobbe.se
-- HikaShop version -- : latest
-- Joomla version -- : 2.5.17
-- PHP version -- : 5.3.3
-- Browser(s) name and version -- : Any browser
-- Error-message(debug-mod must be tuned on) -- : No errors

HI,
I want to change default unit from kg to g in the weight setting for products and product features, how can I do that?
I need this because all my products are in grams and it will save a lot of time not having to change from kg to g every time and it will minimize the errors due to the fact I have forgot to change...
Thanks!

Last edit: 10 years 3 months ago by LAMF. Reason: add info

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
10 years 3 months ago #140063

Hi,

You need to change the order of the weight units in the "weight units" option of the configuration for that.

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

  • Posts: 299
  • Thank you received: 2
10 years 3 months ago #140101

Hi
Ok thanks I found it but it is still the kg option that is default value even if the g is the first choice in the drop down list.
Is this some kind of cache issue?
I have tried to clean cache as well but it is still kg that is the choice default...

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
10 years 3 months ago #140133

Even for new products ?
That shouldn't be the case. Can you do a screenshot of the weight unit option ?

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

  • Posts: 299
  • Thank you received: 2
10 years 3 months ago #140224

HI,
No you're right not for new products but for old ones that I want to put in weight values in the kg is still the primary option.
Also if I copy old product sin order to save time the kg is default. No way around this?

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
10 years 3 months ago #140286

Hi,

Yes, that's normal since the weight unit that you previously selected is stored along with the product data.
If you want to change the weight unit of all the existing products to g, then create a new mass action via the menu System>Mass actions and add an action "update the value" on the field "product_weight_unit" and set the string "g" to it. Then run the mass action and that's it.

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

  • Posts: 299
  • Thank you received: 2
10 years 2 months ago #140339

Hi,
I followed your clear guide and when the action was created I ran the action by pressing the Process button.
System message follows:
"Save success"
and
"Incorrect type for this column, type is decimal unsigned"

And when checking an already existing product it's still kg as the default value even if g is above kg in the drop down meny.

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
10 years 2 months ago #140358

Can you do a screenshot of the options of your mass action ?

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

  • Posts: 299
  • Thank you received: 2
10 years 2 months ago #140505

Hi,
Sorry fo rlate response... here it is.



I wonder if it also is possible to do a mass action in order to change the number of products that are displayed in the category view?
If you select a product category in the left menu on my site it display 21 products per page, this is not optimal when I have 4 products per row so instead I would like to display 20 or 24 products. The problem is that I have a lot of categories and I don't want to change one by one.

Last edit: 9 years 2 months ago by LAMF.

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

  • Posts: 12953
  • Thank you received: 1778
10 years 2 months ago #140540

Hi,
1. As Nicolas said you'll have to update the "product_weight_unit" column and not the "product weight" one.

2. The best solution will probably be to edit the associated content module of your category listing content menu/module through "HIkashop->Display->Content menus/modules" and use the "number of items" option.

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

  • Posts: 299
  • Thank you received: 2
10 years 2 months ago #140608

Hi,
Now I tried that as well but still no luck... well well I give up no harm but if it would have workked it would have been nice though.
The other question about channging the number of listed products unde a category, I know where tp change it but not how or even if it's possible to do a mass action in order to channge that value for all product categores products listing in one go.
Here is where you change it for each product:

Last edit: 9 years 2 months ago by LAMF.

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
10 years 2 months ago #140627

No there is no option to change an option of all the modules/menus at once.
Actually, if you leave the option empty in all your listings options, they will automatically use the default value of the configuration and thus, you can change the number of elements of all the listings of the shop at once by simply changing the default value of the configuration in that case.
But since your modules/menus don't have that field empty, you'll have to modify all of them manually.

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

  • Posts: 146
  • Thank you received: 2
9 years 2 months ago #188145

weight units in the "weight units" option of the configuration

Is this the same as Weight Symbols? If not, where in the configuration is the default set? I cannot seem to find it.

Thanks.

Last edit: 9 years 2 months ago by Xavier.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 2 months ago #188156

Hi,

Yes the option is weight symbols.

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

  • Posts: 146
  • Thank you received: 2
9 years 2 months ago #188221

To change the default from kg to lb and in to m, do I just change the order listed?

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

  • Posts: 13201
  • Thank you received: 2322
9 years 2 months ago #188232

Hi,

Yes if you put "lb" at first, so when creating new products the default weight unit will be "lb".

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

  • Posts: 248
  • Thank you received: 7
  • Hikamarket Multivendor Hikashop Business
7 years 8 months ago #246320

I've followed the steps listed in this discussion for changing the default weight unit, and it works for the main product, but doesn't for the Variants. I need lb and not kg as the default for the variant input form.
How can this be accomplished?

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
7 years 8 months ago #246344

Hi,

Try replacing the code:

if(!empty($concat) && count($concat))
							$p_code = 'CONCAT('.$p_code.', '.implode(',\'_\',', $concat).')';
						$query = 'INSERT IGNORE INTO '.hikashop_table('product').' (product_code, product_type, product_parent_id, product_published, product_modified, product_created, product_group_after_purchase) '.
							' SELECT '.$p_code.' as c_product_code, '. $this->database->Quote('variant') .','. (int)$product_id . ','.(int)$config->get('variant_default_publish',1).',' . $t . ',' . $t . ',' . $this->database->Quote(@$element->product_group_after_purchase) .
by:
						$config =& hikashop_config();
						$symbols = explode(',',$config->get('weight_symbols', 'kg,g'));
						$weight_unit = $symbols[0];
						$symbols = explode(',', $config->get('volume_symbols', 'm,cm'));
						$volume_unit = $symbols[0];
						
						if(!empty($concat) && count($concat))
							$p_code = 'CONCAT('.$p_code.', '.implode(',\'_\',', $concat).')';
						$query = 'INSERT IGNORE INTO '.hikashop_table('product').' (product_code, product_type, product_parent_id, product_published, product_modified, product_created, product_group_after_purchase, product_weight_unit, product_dimension_unit) '.
							' SELECT '.$p_code.' as c_product_code, '. $this->database->Quote('variant') .','. (int)$product_id . ','.(int)$config->get('variant_default_publish',1).',' . $t . ',' . $t . ',' . $this->database->Quote(@$element->product_group_after_purchase).','.$this->database->Quote($weight_unit).','.$this->database->Quote($volume_unit).
							' FROM ' . implode(', ', $tables);
in the file administrator/components/com_hikashop/classes/product.php
Note that it will only work when you create new variants. Existing ones won't be affected.

The following user(s) said Thank You: a2zcs

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

  • Posts: 248
  • Thank you received: 7
  • Hikamarket Multivendor Hikashop Business
7 years 8 months ago #246392

Perfect!
Thanks!

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

  • Posts: 102
  • Thank you received: 4
  • Hikashop Multisite
1 year 3 months ago #348347

Someones selling that good good in grams lol

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

Time to create page: 0.134 seconds
Powered by Kunena Forum