Forums / Setting Up Categories, Products, Attributes / Changing Weight from Pounds to Kilos

Changing Weight from Pounds to Kilos

Locked

Views: 33,811

Results 41 to 54 of 54
This thread is locked. New replies are disabled.
6 May 2010, 1:59 PM
#41
ajeh avatar

ajeh

Oba-san

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

Changing Weight from Pounds to Kilos

You need to edit the order.php class file ...
/includes/classes/order.php

First follow where the table references for:
TABLE_PRODUCTS_ATTRIBUTES

are and add your new field references there ...

Next follow where the table references for:
TABLE_ORDERS_PRODUCTS_ATTRIBUTES

and add your new field references ...

Then, you need to do the same, similar thing in the Admin order.php class:
/admin/includes/classes/order.php

It takes a bit of sorting out, but should help you get this information from the

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

7 May 2010, 4:15 AM
#42
dilani_ruwanmali avatar

dilani_ruwanmali

New Zenner

Join Date:
Feb 2010
Location:
Sri_lanka
Posts:
26
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

hi ajah,
thanks for the instructions.
i have changed the files you mention already.in checkout page

Qty. Item Name Total
1 x President Orthopaedic Divan Guest Bed £249.99

    * add mettress?($450): Yes (**item code**)

this display part is from tpl_checkout_split.php
if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0 ) {echo '<ul class="cartAttribsList">'; for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
echo '<li>' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br($order->products[$i]['attributes'][$j]['value']).'</li>';

i tried to add . $order->products[$i]['attributes'][$j]['itemcode'] . but it wont disply.

and i want to know from which file the order_attributes inserted to date base.then i can edit it to add the item_code .:unsure:

is that ok.....................ohhhhhhhhhhh :lamo:

7 May 2010, 4:56 AM
#43
ajeh avatar

ajeh

Oba-san

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

Re: Changing Weight from Pounds to Kilos

You have to follow the code in the whole order.php to manage a field that needs to go from the products_attributes table to the orders_products_attributes table ...

Try a search on:
prefix

to see where the fields are used ...

You have to extract the field from the products_attributes table to add it to the orders_products_attributes table ...

And while this is a vague search, try a search on:
$attributes

to also follow the pattern ...

Think about what fields/data are currently being stored in both tables ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

7 May 2010, 11:45 AM
#44
dilani_ruwanmali avatar

dilani_ruwanmali

New Zenner

Join Date:
Feb 2010
Location:
Sri_lanka
Posts:
26
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

Attachment #7477
please checkthis, i think theres no prob with this.:cry:

7 May 2010, 12:19 PM
#45
dilani_ruwanmali avatar

dilani_ruwanmali

New Zenner

Join Date:
Feb 2010
Location:
Sri_lanka
Posts:
26
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

i think before the extraction i want to knoe from where the order products attributes are add to the table.from which file the order_product_attributes table get updated?i mean inserting.....

7 May 2010, 4:06 PM
#46
ajeh avatar

ajeh

Oba-san

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

Re: Changing Weight from Pounds to Kilos

If you have the field added a new field to the products_attributes table and to the orders_products_attributes table ...

And you want to get the data from the products_attributes table to the orders_products_attributes table during the completion of an Order ...

You do your work in the:
/includes/classes/order.php

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

7 May 2010, 4:17 PM
#47
ajeh avatar

ajeh

Oba-san

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

Re: Changing Weight from Pounds to Kilos

What version of Zen Cart are you working in?

This order.php for the class looks like something from 2005 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 May 2010, 3:40 AM
#48
dilani_ruwanmali avatar

dilani_ruwanmali

New Zenner

Join Date:
Feb 2010
Location:
Sri_lanka
Posts:
26
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

i am using 1.3.7.1 version.to check whether the order products adding to the attributes table is it necessary the payment to be done???:(

8 May 2010, 3:49 AM
#49
ajeh avatar

ajeh

Oba-san

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

Re: Changing Weight from Pounds to Kilos

You cannot just mix and match versions of files ...

You said earlier you were using v1.3.8 ... but you now are using a v1.3.7.1 order.php file ...

You need to decide if you want the new field that is in the Catalog to show on the Order in the Admin ...

If you need this information in the Admin on the Order for the Attributes then you need to customize the order.php class file to add the information from the products_attributes table to the orders_products_attributes table ...

If you do not need this in the Order of the Admin then you don't have to do anything with that field ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 May 2010, 3:51 AM
#50
ajeh avatar

ajeh

Oba-san

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

Re: Changing Weight from Pounds to Kilos

Also, note that the file:
tpl_checkout_split.php

is not part of Zen Cart so you must be using some sort of Add On ... so it makes it very hard to determine what you need help with beyond this ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 May 2010, 5:16 AM
#51
dilani_ruwanmali avatar

dilani_ruwanmali

New Zenner

Join Date:
Feb 2010
Location:
Sri_lanka
Posts:
26
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

:frusty:
i think i made u confuse.i have mention earlier abt version 1.3.8a is regarding the web site i have created.
this web i mention u is a existing old one,my company wants me to done the changes to display the item code.it is on 1.3.7.1
tpl_checkout_split have an echo line ,when i comment it attributes wont display in both check out and checkout confirmation pages.
shall i mail u the tpl_checkout and tpl_checkout_confirmation page.
i have made all the changes on order.php file.but tables wont get updated.if u dnt mind plz help me on this...i am sooo frustrated..........:cry::cry::cry::cry::cry:

8 May 2010, 12:50 PM
#52
ajeh avatar

ajeh

Oba-san

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

Re: Changing Weight from Pounds to Kilos

You need to explain clearly if you are just trying to display this information on the checkout or if you need this information also showing in the Order on the Admin ...

You appear to have the right idea on the code but you have it all commented out ...

Without actually sitting down and doing all of this work for your site it is hard to say specifically what all has to be changed as you are using a very old and out dated version of Zen Cart along with an add on changing how the checkout works ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

10 May 2010, 4:30 AM
#53
dilani_ruwanmali avatar

dilani_ruwanmali

New Zenner

Join Date:
Feb 2010
Location:
Sri_lanka
Posts:
26
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

:smile:
first i need to appear the item code on checkout and checkout confirmation page.is it possible..?:unsure::unsure::unsure:

13 May 2010, 11:37 AM
#54
limousin avatar

limousin

New Zenner

Join Date:
Nov 2008
Posts:
20
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

Hi all,

hope someone can help.

having trouble with changing weight from lbs to kg, have changed in all the files mentioned and it works great, i.e on the checkout it shows the weight as kg however, upon continue checkout I get blank page so something is messed up, this only happens after editing the includes/languages/english/modules/shipping/zones.php
replace the zones.php with backup file and all works but back to showing lbs.

any ideas, I am editing the file in php editor.

version 1.38a

thanks