1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31: 32: 33:
34: class Mage_Usa_Block_Adminhtml_Dhl_Unitofmeasure extends Mage_Adminhtml_Block_System_Config_Form_Field
35: {
36:
37: 38: 39: 40: 41:
42: public function _construct()
43: {
44: parent::_construct();
45:
46: $carrierModel = Mage::getSingleton('usa/shipping_carrier_dhl_international');
47:
48: $this->setInch($this->jsQuoteEscape($carrierModel->getCode('unit_of_dimension_cut', 'I')));
49: $this->setCm($this->jsQuoteEscape($carrierModel->getCode('unit_of_dimension_cut', 'C')));
50:
51: $this->setHeight($this->jsQuoteEscape($carrierModel->getCode('dimensions', 'height')));
52: $this->setDepth($this->jsQuoteEscape($carrierModel->getCode('dimensions', 'depth')));
53: $this->setWidth($this->jsQuoteEscape($carrierModel->getCode('dimensions', 'width')));
54:
55: $kgWeight = 70;
56:
57: $this->setDivideOrderWeightNoteKg(
58: $this->jsQuoteEscape($this->__('Allows breaking total order weight into smaller pieces if it exeeds %s %s to ensure accurate calculation of shipping charges.', $kgWeight, 'kg'))
59: );
60:
61: $weight = round(
62: Mage::helper('usa')->convertMeasureWeight(
63: $kgWeight, Zend_Measure_Weight::KILOGRAM, Zend_Measure_Weight::POUND), 3);
64:
65: $this->setDivideOrderWeightNoteLbp(
66: $this->jsQuoteEscape($this->__('Allows breaking total order weight into smaller pieces if it exeeds %s %s to ensure accurate calculation of shipping charges.', $weight, 'pounds'))
67: );
68:
69: $this->setTemplate('usa/dhl/unitofmeasure.phtml');
70: }
71:
72: 73: 74: 75: 76: 77:
78: protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
79: {
80: return parent::_getElementHtml($element) . $this->renderView();
81: }
82: }
83: