Australia Post - Warning: Division by zero

  • Posts: 191
  • Thank you received: 5
10 years 2 months ago #202771

-- url of the page with the problem -- : www.littletreasurebox.com.au/website/index.php/collection
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1

Hello,

I am having some issues with Australia Post, it gives me the following warning:
Warning: Division by zero in /home/littlet4/public_html/website/plugins/hikashopshipping/aupost/aupost.php on line 33

All products have a weight. I have attached an image of the Australia Post setup and the error on page.

I hope you can help :).

Thank you
Kind regards
Lene

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
10 years 2 months ago #202814

Hi,

Thanks for the report ; this issue has already been fixed in HikaShop and will be include in the next HikaShop release.
All your products have a weight but it looks like that some does not have dimensions.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 191
  • Thank you received: 5
10 years 2 months ago #202873

Hi Jerome,

OK, is this easy to import by just adding product code and dimension? I really do not want to stuff up the product listings now. I know we can setup manual postage, I will check with my client. Some of the products are tiny, hard to measure.

Thank you
Regards
Lene

Please Log in or Create an account to join the conversation.

  • Posts: 191
  • Thank you received: 5
10 years 2 months ago #202897

Hi Jerome,

My client has decided to go with manual postage so that solves my problem.

I just saw that I posted this in the wrong category.... sorry.

Thanks
Lene

Please Log in or Create an account to join the conversation.

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
10 years 2 months ago #202876

Hi,

The dimensions are using to calculate the "girth", in order to check that the package is not too big for shipping.

If you do not want to specify dimension, you can see to update manually the plugin, by replacing

			case 'volume':
				if(($product['x'] * $product['y'] * $product['z']) > $limit_value)
					return false;
				return (int)floor($limit_value / ($product['x'] * $product['y'] * $product['z']));
				break;
			case 'girth':
				if(($product['x'] + $product['y']) * 2  > $limit_value)
					return false;
				return (int)floor($limit_value / (($product['x'] + $product['y']) * 2 ));
				break;
By
			case 'volume':
				$divide = (float)($product['x'] * $product['y'] * $product['z']);
				if(empty($divide) || $divide > $limit_value)
					return false;
				return (int)floor($limit_value / $divide);
				break;
			case 'girth':
				$divide = (float)(($product['x'] + $product['y']) * 2);
				if(empty($divide) || $divide > $limit_value)
					return false;
				return (int)floor($limit_value / $divide);
				break;
In the file "plugins/hikashopshipping/aupost/aupost.php"

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum