|
Hi
Very busy weekend with too many (magento) software surprises, but the store made it up online (http://www.thedeviantsasylum.com/) with the canada post shipping module. An order was created, packaged and brought to canada post to verify the shipping costs to 5 different provinces and 1 state. The test was successful.
There are some changes (bugs) in the magento core which needed to be fixed to display the shipment “detail”. This detail shows what containers and what items are to be placed in the containers. It is an optional feature so the changes do not have to be made to the core if you do not need to use this feature. In a future release of magento maybe you will not have to do these changes…
SQL Code to execute: This code converts the shipping description attribute and the flat table (sales_flat_quote_address) shipping description field to a TEXT field. The reason for this is that the shipment detail can be longer then the 255 character fields allocated for the shipping description. The reason why this is a bug is because the quote method description, which populates the shipping description, is a text field. By executing this sql you may affect existing shipping statements since the existing shipping statements will be expecting the data to be stored in a “varchar” field and not in the “text” field.
SQL to change the shipping description field to allow for more then 255 chars
UPDATE eav_attribute set backend_type='text' where attribute_code='shipping_description' and entity_type_id=11; ALTER TABLE `sales_flat_quote_address` CHANGE `shipping_description` `shipping_description` TEXT NOT NULL;
In case you run into problems the following sql will revert any changes back to what it currently is
Code to revert back
UPDATE eav_attribute set backend_type='varchar' where attribute_code='shipping_description' and entity_type_id=11; ALTER TABLE `sales_flat_quote_address` CHANGE `shipping_description` `shipping_description` VARCHAR(255) NOT NULL;
Changes to magento core
app/code/core/Mage/Sales/Model/Quote/Address/Rate.php Line 62 old:
public function importShippingRate(Mage_Shipping_Model_Rate_Result_Abstract $rate) { if ($rate instanceof Mage_Shipping_Model_Rate_Result_Error) { $this ->setCode($rate->getCarrier().'_error') ->setCarrier($rate->getCarrier()) ->setCarrierTitle($rate->getCarrierTitle()) ->setErrorMessage($rate->getErrorMessage()) ; } elseif ($rate instanceof Mage_Shipping_Model_Rate_Result_Method) { $this ->setCode($rate->getCarrier().'_'.$rate->getMethod()) ->setCarrier($rate->getCarrier()) ->setCarrierTitle($rate->getCarrierTitle()) ->setMethod($rate->getMethod()) ->setMethodDescription($rate->getMethodTitle()) ->setPrice($rate->getPrice()) ; } return $this; }
New
public function importShippingRate(Mage_Shipping_Model_Rate_Result_Abstract $rate) { if ($rate instanceof Mage_Shipping_Model_Rate_Result_Error) { $this ->setCode($rate->getCarrier().'_error') ->setCarrier($rate->getCarrier()) ->setCarrierTitle($rate->getCarrierTitle()) ->setErrorMessage($rate->getErrorMessage()) ; } elseif ($rate instanceof Mage_Shipping_Model_Rate_Result_Method) { $this ->setCode($rate->getCarrier().'_'.$rate->getMethod()) ->setCarrier($rate->getCarrier()) ->setCarrierTitle($rate->getCarrierTitle()) ->setMethod($rate->getMethod()) ->setMethodTitle($rate->getMethodTitle()) // new ->setMethodDescription($rate->getMethodDescription()) // changed ->setPrice($rate->getPrice()) ; } return $this; }
Once again the code changes are only necessary if you want to show the shipment details (which items go into which box)
The module will be submitted for admission today (sept 8 2008)
BTW Do you like the product rotation on the front page ? (you may need to wait a bit to see it .. http://www.thedeviantsasylum.com/)
z
|