View Single Post
  #4  
Old 10-13-2006, 08:54 AM
 
syddos syddos is offline
 

eXpert
  
Join Date: Sep 2002
Location: London, England, UK
Posts: 259
 

Default Re: Weight to three decimal places

Note: I only have an X-Cart PRO license, and only v4.1.X setup for testing, so the skin1 directories may differ for X-Cart GOLD and Gold versions.

DATABASE TABLES
Using phpadmin or similar editor, view the ⌠structure page■

xcart_products
In the FIELD column locate weight
In the TYPE column, change the entry from decimal(12,2) to decimal(12,3)
In the DEFAULT column, change 0.00 to 0.000

xcart_shipping
In the FIELD column locate weight_min and weight_limit
In the TYPE column, change the entry from decimal(12,2) to decimal(12,3)
In the DEFAULT column, change 0.00 to 0.000

xcart_shipping_rates
In the FIELD column locate minweight and maxweight
In the TYPE column, change the entry from decimal(12,2) to decimal(12,3)
In the DEFAULT column, change 0.00 to 0.000


TEMPLATE FILES
admin/main/shipping.tpl

This following appears in 3 lines of code, each in a different template section, also make sure to check the extreme RIGHT of the editing page, as some of these lines a very long.

Code:
Search for "data[{$s.shippingid}][weight_min]" Change value="{$s.weight_min|default:0.00|formatprice}" To value="{$s.weight_min|default:0.000|formatnumeric}" For "data[{$s.shippingid}][weight_limit]" Change value="{$s.weight_limit|formatprice}" To value="{$s.weight_limit|formatnumeric}"

Code:
The following appears in 1 line of code only in this template. Search for "add[weight_min]" Change value="{0.00|formatprice}" To value="{0.000|formatnumeric}" For "add[weight_limit]" Change value="{0.00|formatprice}" To value="{0.000|formatnumeric}"

----------------------------------------------------------------------------------------------------------------------------------

customer/main/product.tpl
Search for {if $product.weight ne "0.00"}
Change to {if $product.weight ne "0.000"}

Search for {$product.weight|formatprice}
Change to {$product.weight|formatnumeric}

----------------------------------------------------------------------------------------------------------------------------------

skin1/main/product_details.tpl
Search for { $product.weight|formatprice|default:$zero }
Change to { $product.weight|formatnumeric|default:$zero }

----------------------------------------------------------------------------------------------------------------------------------

provider or admin/main/shipping_rates.tpl
Code:
Search for "posted_data[{$shipping_rate.rateid}][minweight]" Change value="{$shipping_rate.minweight|formatprice}" To value="{$shipping_rate.minweight|formatnumeric}" For "posted_data[{$shipping_rate.rateid}][maxweight]" Change value=■{$shipping_rate.maxweight|formatprice}■ To value="{$shipping_rate.maxweight|formatnumeric}"

These changes will display 3 decimal places on product pages, and on the "Add"/"Display" admin/provider shipping and shipping rates pages.
__________________
Syddos

Nothing is impossible, We just don't know how to do it ........Yet!

Xcart 4.1.X PRO (Testing Platform: winXP Pro)
Perl 5.8.7 (win32)
WINAMP 1.6.3 (win32 server package. Includes the following)
- phpMyAdmin v2.8.03
- MySql 5.0.21
- Apache 2.0.55 (win32)
- php 5.1.4
- SQLitemanager 1.2.0
Reply With Quote