Jump to content

KG to G and CM to MM


Recommended Posts

Update: I think you can at least specify spatial dimensions via your CubeCart upload spreadsheet, using the following column headings:

Product Width Product Height Product Depth

Dimension Unit

That will allow you to specify the dimenion unit as m, cm, mm, inches, etc. - at least l think so.

Link to comment
Share on other sites

The product weight is used by every shipping module in its calculations, so as such, maintaining a strict adherence to a configured weight unit is necessary for not making shipping more complicated than necessary. The weight unit is set in the Store Settings and is used as the weight unit for the weight amounts everywhere.

To add another configuration choice for the weight unit, see:

https://forums.cubecart.com/topic/56313-need-help-on-how-to-change-the-default-product-weight/

Again, this will be used everywhere. So, if shipping grams, be absolutely sure you get quotes from your shippers for gram weights.

In my opinion, there is not much to be concerned about the dimension unit for width, height, and depth -- unless you are shipping other than parcels (boxes), such as first-class flats (which have size considerations).

So, to add a new dimension unit:

In the admin skin template products.index.php, near lines 186-189, find:

    <select name="dimension_unit" id="dimension_unit">
        <option{if $PRODUCT.dimension_unit=='cm'} selected='selected'{/if} value="cm">Centimeters (cm)</option>
        <option{if $PRODUCT.dimension_unit=='in'} selected='selected'{/if} value="in">Inches (in)</option>
    </select>

Change to:

    <select name="dimension_unit" id="dimension_unit">
        <option{if $PRODUCT.dimension_unit=='mm'} selected='selected'{/if} value="mm">Millimeters (mm)</option>
        <option{if $PRODUCT.dimension_unit=='cm'} selected='selected'{/if} value="cm">Centimeters (cm)</option>
        <option{if $PRODUCT.dimension_unit=='in'} selected='selected'{/if} value="in">Inches (in)</option>
    </select>

The selected dimension unit option will be stored in the product's database record and is available to be displayed on the View Product storefront page.

Be aware that the database table CubeCart_inventory has initially a default value of 'cm' that is used when a record gets inserted that does not have these fields present (as when importing products from a CSV file). This default value gets changed (the database table is ALTERed) to match the culturally appropriate weight unit. That is, when changing the store setting from metric weight (Kg) to Imperial (Lb), a command is sent to the database to change the default length dimension unit from 'cm' to 'in'. This change does not affect any established data -- products listed in 'cm' will stay 'cm'.

Also note that the maximum number of characters the 'dimension_unit' database column in CubeCart_inventory can hold is two.

Link to comment
Share on other sites

Hi there, according to my notes, the original template upload spreadsheet that used to be available, allowed you to specify spatial dimension units.

I too am unsure why it'd be needed except that some sophisticated shipping modules may use that info to give very precise shipping costs (taking into account volume and weight, i.e. volumetric weight).

 

 

By the way l just saw your solution for forcing weight to be g rather than kg i.e. post #4 at

https://forums.cubecart.com/topic/56313-need-help-on-how-to-change-the-default-product-weight/
Edited by cubicsquare
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...