Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / How can I set a default shipping weight?

How can I set a default shipping weight?

Locked

Views: 1,115

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
28 Apr 2008, 4:29 PM
#1
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

How can I set a default shipping weight?

I know that Zencart doesn't care much about kg, oz, lb.... or what ever.
BUT... is it possible to set a default weight so, when your store has all products one weight, you don't have to add it into every product?

30 Apr 2008, 3:52 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How can I set a default shipping weight?

You can customize the code for adding new products with a specific weight by changing the code in the file:
/admin/includes/modules/product/collect_info.php

NOTE: if you use various Product Types you need to update their collect_info.php file as well ...

And in the first section of the code you will see:

    $parameters = array('products_name' => '',
                       'products_description' => '',
                       'products_url' => '',
                       'products_id' => '',
                       'products_quantity' => '',
                       'products_model' => '',
                       'products_image' => '',
                       'products_price' => '',
                       'products_virtual' => DEFAULT_PRODUCT_PRODUCTS_VIRTUAL,
                       'products_weight' => '',
                       'products_date_added' => '',
                       'products_last_modified' => '',
                       'products_date_available' => '',
                       'products_status' => '',
                       'products_tax_class_id' => DEFAULT_PRODUCT_TAX_CLASS_ID,
                       'manufacturers_id' => '',
                       'products_quantity_order_min' => '',
                       'products_quantity_order_units' => '',
                       'products_priced_by_attribute' => '',
                       'product_is_free' => '',
                       'product_is_call' => '',
                       'products_quantity_mixed' => '',
                       'product_is_always_free_shipping' => DEFAULT_PRODUCT_PRODUCTS_IS_ALWAYS_FREE_SHIPPING,
                       'products_qty_box_status' => PRODUCTS_QTY_BOX_STATUS,
                       'products_quantity_order_max' => '0',
                       'products_sort_order' => '0',
                       'products_discount_type' => '0',
                       'products_discount_type_from' => '0',
                       'products_price_sorter' => '0',
                       'master_categories_id' => ''
                       );

Set your products_weight equal to a value instead of being blank ...

To update all existing Products, if you need to change all to have the right weight, you can run from the Tools ... Install SQL Patches ...

UPDATE products SET products_weight = ##;

where ## is the weight you want to set ...

NOTE: Backing up your database is always a good idea before doing global updates ...

NOTE: There are no overrides in the Admin so save your original file(s) plus your changed file(s) for future upgrades ...