Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hello Again,

 

 

I was just wondering if it were possible to add a package qty box in the product entry page; a simple text box that the user could specify the number of boxes the product would ship in. I would think this would have to over-ride the dimensional support. The product weight could then be divided by the number specified in this box.

 

I am not sure how to incorporate this or even where to start as my PHP is at a beginner level. If anyone may know how or where to start any help would be greatly appreciated. Thanks.

 

:D

Posted
I was just wondering if it were possible to add a package qty box in the product entry page; a simple text box that the user could specify the number of boxes the product would ship in. I would think this would have to over-ride the dimensional support. The product weight could then be divided by the number specified in this box.
You can add your own logic for certain products in the catalog/includes/modules/shipping/upsxml.php file (around line 224) where the products and dimensions are imported into upsxml.php:

		$productsArray = $cart->get_products();
			if ($this->dimensions_support > 0) {
				$productsArray = $this->more_dimensions_to_productsArray($productsArray);
			}

	if ($this->dimensions_support == '2') {
		// sort $productsArray according to ready-to-ship (first) and not-ready-to-ship (last)
		usort($productsArray, ready_to_shipCmp);
		// Use packing algoritm to return the number of boxes we'll ship

You could e.g. go through the $productsArray and then change/pack the particular product to your needs, mark the packed product as ready_to_ship and then let the code continue pack the rest of the products. The information needed for a/the particular product(s) could be read from a text file.

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