Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Getting package weight to display


TerryK

Recommended Posts

I'm trying to get the total shipping weight to display for table-based shipping methods on catalog/checkout_shipping.php.

 

The UPS module includes the weight using this code:

 

        $this->quotes = array('id' => $this->code,
                             'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'lbs)');

 

The code in my table-based file looks like this:

 

      $this->quotes = array('id' => $this->code,
                           'module' => MODULE_SHIPPING_USPOSTTABLE_TEXT_TITLE,
                           'methods' => array(array('id' => $this->code,
                                                    'title' => MODULE_SHIPPING_USPOSTTABLE_TEXT_WAY,
                                                    'cost' => $shipping + MODULE_SHIPPING_USPOSTTABLE_HANDLING)));

 

I tried changing it to:

 

      $this->quotes = array('id' => $this->code,
                           'module' => MODULE_SHIPPING_USPOSTTABLE_TEXT_TITLE . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'lbs)'),
                           'methods' => array(array('id' => $this->code,
                                                    'title' => MODULE_SHIPPING_USPOSTTABLE_TEXT_WAY,
                                                    'cost' => $shipping + MODULE_SHIPPING_USPOSTTABLE_HANDLING)));

 

but totally crashed my admin shipping modules section as well as the checkout_shipping.php page due to fatal 'cannot instantiate class' errors when I tried to change it. After many hours of trial and error, ultimately deleting my existing files and uploading new files with a completely different name, I've managed to get it back. But now I'm afraid to try modifying this again for fear of running into the same problem!

 

Can anyone tell me if there's something in the above code that's incorrect? Or, if anyone has managed to get the weight to display for table-based shipping, please share your secrets!

 

Many thanks in advance...

 

Terry

Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Link to comment
Share on other sites

One more search through the forum using another set of keywords, and I found a workaround. :)

 

Instead of incorporating the weight in with the shipping method, I've added it as a separate line under the cart contents, within a <td> cell, using this code:

 

<?php echo $cart->show_weight(); ?>

 

You can see it in action via the WWW link below. Add something to your cart, go to cart contents and voila! There it is!

 

Hope this helps someone else...

 

Terry

Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Link to comment
Share on other sites

Terry,

 

Thanks a whole bunch!

 

The method that you tried was exctly the same as mine! i.e. showing the weight in checkout_shipping!

 

Unfortunately, I had the same result as you :(

 

Thanks again for the workaround....will give it a bash.

 

Cheers.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...