Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted (edited)

Hi guys,

 

I've come across this contribution "Dimensional Weight", but it's only suitable for v2.2:

 

http://addons.oscommerce.com/info/1255/

 

I've gone through it, and I think I have it all working for 2.3.3 (once I do know it's working, I will add modified instructions to the package for everyone), but I am not entirely sure.

 

I have 2 issues with the code, but here's where my main problem lies:

 

In catalog/checkout_process.php

/======== FIND ==========/

$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);

/======== ADD AFTER ==========/

$total_volume += ($order->products[$i]['qty'] * $order->products[$i]['volume']);

/======== END ==========/

 

The problem is, that line doesn't exist in v2.3.3!

 

This is the code from that part of the file for V2.2

 

//------insert customer choosen option eof ----
$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;

$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}

 

And this is the code from the same area in v2.3.3:

 

//------insert customer choosen option eof ----
$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}

 

My question is, for the code-savvy of you out there, can I just add in the missing lines and the new contribution line, like this?...

 

//------insert customer choosen option eof ----
$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
$total_volume += ($order->products[$i]['qty'] * $order->products[$i]['volume']);
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;

$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}

 

Can anyone see any potential problems with this? As I say, I've got it all added to a new store I'm working on at the moment, but have no reference for how it should work! All I know is that I can go through the checkout process and not get any errors... what I don't know however, is whether osC is just ignoring my extra lines of code?!

 

It'll be a great addition to 2.3.x if I can be sure it's working, but I need a little help from those who actually have a deeper/better understand of the code please.

 

Thanks in advance.

 

Andy.

 

Edit: Oops, sorry! Just seen this should be in "Shipping", not general!

Edited by mc21repsol

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...

×   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.

×
×
  • Create New...