Skip to content
View in the app

A better way to browse. Learn more.

Clicshopping AI, Free generative artificial intelligence e-commerce Open Source , Open Source Store Onlne

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Weight configuration& conversion

Featured Replies

Hello,

 

Inside the products admin page, There are 2 fields for the weight, one for the weight, one for the weight type.

my question is I want to make a module to display different weight type conversion.
Can I do that, or I make to write something to display the conversion.

Example : Kg => Lb

Edited by Snoopy

Hello @Snoopy

If you look inside the administration Configuration, you a weight menu where can add different weight conversation.

Now how to make that on the catalog !

Below the element can help you. This code allow you to convert all in Kg.

$CLICSHOPPING_Weight = Registry::get('Weight');
$CLICSHOPPING_ProductsCommon = Registry::get('ProductsCommon');

$defaultUnitWeight = SHIPPING_WEIGHT_UNIT; // 2 in the default configuration KG

shipping_weight = getProductsWeight

// Take only the kg 

// gr to kg
if ( $defaultUnitWeight == 1) { 
  $weight  = round($CLICSHOPPING_Weight->convert($shipping_weight, $defaultUnitWeight, 2), 3); 
} 

//Ounce to kg 
if ( $defaultUnitWeight == 3) { 
  $weight = round($CLICSHOPPING_Weight->convert($shipping_weight, $defaultUnitWeight, 2), 3); 
} 

//Ounce to kg 
if ( $defaultUnitWeight == 4) { 
  $weight = round($CLICSHOPPING_Weight->convert($shipping_weight, $defaultUnitWeight, 2), 3); 
}

echo $weight;

 

Edited by Patrick

  • Author

Ok thank you,

I just basic knowledge in php. 

Your answer is cool

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.