وردپرس
Girth | WordPress.org
Hi Team,
Slight bug in the plugin. Girth is being the limiting factor for a domestic shipment, 140cm Girth is only a requirement for International shipment.
The restriction for domestic shipping is 0.25 cubic metres.
https://auspost.com.au/business/shipping/guidelines/size-weight-guidelines
Workaround to get me by is below, however it would be nice to have this handled in the official code base.
// Min sizes - girth minimum is 16cm
$girth = ( round(wc_get_dimension($dimensions[0], 'cm', $from_dimension_unit)) + round(wc_get_dimension($dimensions[1], 'cm', $from_dimension_unit)) ) * 2;
$cubic_meters = (round(wc_get_dimension($dimensions[0], 'cm', $from_dimension_unit)) * round(wc_get_dimension($dimensions[1], 'cm', $from_dimension_unit)) * round(wc_get_dimension($dimensions[2], 'cm', $from_dimension_unit))) / 1000000;
if ($package['destination']['country'] == 'AU') {
if ($parcel['weight'] > 22 || $dimensions[2] > 105 || $cubic_meters > 0.25) {
$this->debug( wp_kses_post('Product ' . $item_id . ' has invalid weight/dimensions. Aborting. See http://auspost.com.au/personal/parcel-dimensions.html', 'wf_australia_post' ), 'error');
return;
}
}elseif ($girth < 16 || $girth > 140) {
$this->debug(sprintf(__('Girth of the product should lie in between 16cm and 140cm. See http://auspost.com.au/personal/parcel-dimensions.html', 'wf_australia_post'), $item_id), 'error');
return;
}
مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد
منبع: انجمن وردپرس