isabel-julie2 Posted April 28, 2014 Share Posted April 28, 2014 Hello, I am using the Canada Post module and Cubecart drops the decimals in the amount recived from Post canada. By example if it returns the amount of 9.37 to cubecart, Cubecart will put 9.00 in the invoice. It does that for every amount, all the time. Ex: a demand journal entry: Demande envoyée - http://sellonline.canadapost.ca/<eparcel> <language>en</language> <ratesAndServicesRequest> <merchantCPCID>CPC_BOUTIQUE_FIL_ART_NS</merchantCPCID> <fromPostalCode>j3y 8x9</fromPostalCode> <itemsPrice>6.50</itemsPrice> <lineItems> <item> <quantity>1</quantity> <weight>0.05</weight> <length>4</length> <width>20</width> <height>20</height> <description>Online Order</description> </item> </lineItems> <city>nantes</city> <provOrState>loire</provOrState> <country>FR</country> <postalCode>44300</postalCode> </ratesAndServicesRequest> </eparcel> Réponse reçue<?xml version="1.0"?> <!DOCTYPE eparcel [ <!-- EVERY REQUEST CONTAIN THE eparcel TAG --> <!ELEMENT eparcel (ratesAndServicesResponse)> <!-- ********************************************************* --> <!-- * Standard response for request for rates and services * --> <!-- ********************************************************* --> <!ELEMENT ratesAndServicesResponse (statusCode, statusMessage+, requestID, handling, language, product+, packing*, emptySpace*, shippingOptions, comment, nearestPostalOutlet*)> <!ELEMENT statusCode (#PCDATA)> <!ELEMENT statusMessage (#PCDATA)> <!ELEMENT requestID (#PCDATA)> <!ELEMENT handling (#PCDATA)> <!ELEMENT language (#PCDATA)> <!ELEMENT product (name, rate, shippingDate, deliveryDate, deliveryDayOfWeek, nextDayAM?, packingID)> <!ATTLIST product id CDATA #REQUIRED sequence CDATA #REQUIRED > <!ELEMENT name (#PCDATA)> <!ELEMENT rate (#PCDATA)> <!ELEMENT shippingDate (#PCDATA)> <!ELEMENT deliveryDate (#PCDATA)> <!ELEMENT deliveryDayOfWeek (#PCDATA)> <!ELEMENT nextDayAM (#PCDATA)> <!ELEMENT packingID (#PCDATA)> <!ELEMENT packing (packingID, box+)> <!ELEMENT box (name, weight, expediterWeight, length, width, height, packedItem+)> <!ELEMENT weight (#PCDATA)> <!ELEMENT expediterWeight (#PCDATA)> <!ELEMENT length (#PCDATA)> <!ELEMENT width (#PCDATA)> <!ELEMENT height (#PCDATA)> <!ELEMENT packedItem (quantity, description)> <!ELEMENT quantity (#PCDATA)> <!ELEMENT description (#PCDATA)> <!ELEMENT emptySpace (length, width, height, weight)> <!ELEMENT shippingOptions (insurance, deliveryConfirmation, signature, flexiblePaymentAvailable?)> <!ELEMENT insurance (#PCDATA)> <!ELEMENT deliveryConfirmation (#PCDATA)> <!ELEMENT signature (#PCDATA)> <!ELEMENT flexiblePaymentAvailable EMPTY> <!ELEMENT comment (#PCDATA)> <!-- ********************************************************* --> <!-- * 'nearestPostalOutlet' is optional and is returned * --> <!-- * only if the merchant profile has this option enabled * --> <!-- ********************************************************* --> <!ELEMENT nearestPostalOutlet (postalOutletSequenceNo, distance, outletName, businessName, postalAddress, phoneNumber, businessHours+)> <!ELEMENT postalOutletSequenceNo (#PCDATA)> <!ELEMENT distance (#PCDATA)> <!ELEMENT outletName (#PCDATA)> <!ELEMENT businessName (#PCDATA)> <!ELEMENT postalAddress (addressLine+, postalCode, municipality, province?)> <!ELEMENT addressLine (#PCDATA)> <!ELEMENT postalCode (#PCDATA)> <!ELEMENT municipality (#PCDATA)> <!ELEMENT province (#PCDATA)> <!ELEMENT phoneNumber (#PCDATA)> <!ELEMENT businessHours (dayId, dayOfWeek, time)> <!ELEMENT dayId (#PCDATA)> <!ELEMENT dayOfWeek (#PCDATA)> <!ELEMENT time (#PCDATA)> ]> <eparcel> <ratesAndServicesResponse> <statusCode>1</statusCode> <statusMessage>OK</statusMessage> <requestID>7604463</requestID> <handling>2.0</handling> <language>0</language> <product id="3040" sequence="1"> <name>Priority Worldwide INTL</name> <rate>84.22</rate> <shippingDate>2014-05-05</shippingDate> <deliveryDate>www.canadapost.ca</deliveryDate> <deliveryDayOfWeek>4</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <product id="3025" sequence="2"> <name>XPressPost International</name> <rate>55.7</rate> <shippingDate>2014-05-05</shippingDate> <deliveryDate>2014-05-09</deliveryDate> <deliveryDayOfWeek>6</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <product id="3000" sequence="3"> <name>Tracked Packet - International</name> <rate>41.0</rate> <shippingDate>2014-05-05</shippingDate> <deliveryDate>2014-05-14</deliveryDate> <deliveryDayOfWeek>4</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <product id="3015" sequence="4"> <name>Small Packets Air</name> <rate>9.37</rate> <shippingDate>2014-05-05</shippingDate> <deliveryDate>up to 2 weeks</deliveryDate> <deliveryDayOfWeek>4</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <product id="3010" sequence="5"> <name>Parcel Surface</name> <rate>34.69</rate> <shippingDate>2014-05-05</shippingDate> <deliveryDate>1 to 3 months</deliveryDate> <deliveryDayOfWeek>4</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <packing> <packingID>P_0</packingID> <box> <name>Enveloppe 9x12</name> <weight>0.37</weight> <expediterWeight>0.065</expediterWeight> <length>28.0</length> <width>20.0</width> <height>4.0</height> <packedItem> <quantity>1</quantity> <description>Online Order</description> </packedItem> </box> </packing> <shippingOptions> <insurance>No</insurance> <deliveryConfirmation>Yes</deliveryConfirmation> <signature>No</signature> </shippingOptions> <comment>* For major centres only. Add 1 to 3 business days for other destinations.</comment> </ratesAndServicesResponse> </eparcel> <!--END_OF_EPARCEL--> and all the choices appear with the decimal dropped into the choices drop down menu for the customers. THis problem existed before and it had been solved, now it reappears. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted April 28, 2014 Share Posted April 28, 2014 Please open classes / language.class.php and find: if (isset($this->_language_data) && isset($GLOBALS['session']) && !empty($this->_language_data)) { $money = ($GLOBALS['session']->has('currency', 'client') && $GLOBALS['session']->get('currency', 'client') == 'EUR') ? '@euro' : ''; setlocale(LC_ALL, $this->_language_data['locale'].'.'.$this->_language_data['character_set'].$money); } Replace with: setlocale(LC_ALL, 'en_US.UTF-8'); Quote Link to comment Share on other sites More sharing options...
isabel-julie2 Posted April 28, 2014 Author Share Posted April 28, 2014 Thank you. I tried but I now get a white page when trying to open my index page. Why have you replaced by en_US ? It it possible that it could be something else? My boutique is in French as the default language. I tried changing it to English but stil had a blanc index page. Thank you Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted April 28, 2014 Share Posted April 28, 2014 en_US is required to set the "internal" decimal formatting correctly. It is then later adapted for European specification. The blank white screen will be a parse error. Try the attached file instead overwriting your existing one. language.class.php Quote Link to comment Share on other sites More sharing options...
isabel-julie2 Posted April 28, 2014 Author Share Posted April 28, 2014 Thank you, Your file is working but I still miss my decimals, they are replaced by .00 Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted April 28, 2014 Share Posted April 28, 2014 I think new data will be ok. Old data will need to be edited. Quote Link to comment Share on other sites More sharing options...
isabel-julie2 Posted April 28, 2014 Author Share Posted April 28, 2014 Unfortunately no. I tested with new data. It still gives me 9.00 instead of 9.37 Aujourd'hui, 13:44 Demande envoyée - http://sellonline.canadapost.ca/<eparcel> <language>en</language> <ratesAndServicesRequest> <merchantCPCID>CPC_BOUTIQUE_FIL_ART_NS</merchantCPCID> <fromPostalCode>j3y 8x9</fromPostalCode> <itemsPrice>6.50</itemsPrice> <lineItems> <item> <quantity>1</quantity> <weight>0.05</weight> <length>4</length> <width>20</width> <height>20</height> <description>Online Order</description> </item> </lineItems> <city>nantes</city> <provOrState>loire</provOrState> <country>FR</country> <postalCode>44300</postalCode> </ratesAndServicesRequest> </eparcel> Réponse reçue<?xml version="1.0"?> <!DOCTYPE eparcel [ <!-- EVERY REQUEST CONTAIN THE eparcel TAG --> <!ELEMENT eparcel (ratesAndServicesResponse)> <!-- ********************************************************* --> <!-- * Standard response for request for rates and services * --> <!-- ********************************************************* --> <!ELEMENT ratesAndServicesResponse (statusCode, statusMessage+, requestID, handling, language, product+, packing*, emptySpace*, shippingOptions, comment, nearestPostalOutlet*)> <!ELEMENT statusCode (#PCDATA)> <!ELEMENT statusMessage (#PCDATA)> <!ELEMENT requestID (#PCDATA)> <!ELEMENT handling (#PCDATA)> <!ELEMENT language (#PCDATA)> <!ELEMENT product (name, rate, shippingDate, deliveryDate, deliveryDayOfWeek, nextDayAM?, packingID)> <!ATTLIST product id CDATA #REQUIRED sequence CDATA #REQUIRED > <!ELEMENT name (#PCDATA)> <!ELEMENT rate (#PCDATA)> <!ELEMENT shippingDate (#PCDATA)> <!ELEMENT deliveryDate (#PCDATA)> <!ELEMENT deliveryDayOfWeek (#PCDATA)> <!ELEMENT nextDayAM (#PCDATA)> <!ELEMENT packingID (#PCDATA)> <!ELEMENT packing (packingID, box+)> <!ELEMENT box (name, weight, expediterWeight, length, width, height, packedItem+)> <!ELEMENT weight (#PCDATA)> <!ELEMENT expediterWeight (#PCDATA)> <!ELEMENT length (#PCDATA)> <!ELEMENT width (#PCDATA)> <!ELEMENT height (#PCDATA)> <!ELEMENT packedItem (quantity, description)> <!ELEMENT quantity (#PCDATA)> <!ELEMENT description (#PCDATA)> <!ELEMENT emptySpace (length, width, height, weight)> <!ELEMENT shippingOptions (insurance, deliveryConfirmation, signature, flexiblePaymentAvailable?)> <!ELEMENT insurance (#PCDATA)> <!ELEMENT deliveryConfirmation (#PCDATA)> <!ELEMENT signature (#PCDATA)> <!ELEMENT flexiblePaymentAvailable EMPTY> <!ELEMENT comment (#PCDATA)> <!-- ********************************************************* --> <!-- * 'nearestPostalOutlet' is optional and is returned * --> <!-- * only if the merchant profile has this option enabled * --> <!-- ********************************************************* --> <!ELEMENT nearestPostalOutlet (postalOutletSequenceNo, distance, outletName, businessName, postalAddress, phoneNumber, businessHours+)> <!ELEMENT postalOutletSequenceNo (#PCDATA)> <!ELEMENT distance (#PCDATA)> <!ELEMENT outletName (#PCDATA)> <!ELEMENT businessName (#PCDATA)> <!ELEMENT postalAddress (addressLine+, postalCode, municipality, province?)> <!ELEMENT addressLine (#PCDATA)> <!ELEMENT postalCode (#PCDATA)> <!ELEMENT municipality (#PCDATA)> <!ELEMENT province (#PCDATA)> <!ELEMENT phoneNumber (#PCDATA)> <!ELEMENT businessHours (dayId, dayOfWeek, time)> <!ELEMENT dayId (#PCDATA)> <!ELEMENT dayOfWeek (#PCDATA)> <!ELEMENT time (#PCDATA)> ]> <eparcel> <ratesAndServicesResponse> <statusCode>1</statusCode> <statusMessage>OK</statusMessage> <requestID>7613923</requestID> <handling>2.0</handling> <language>0</language> <product id="3000" sequence="1"> <name>Tracked Packet - International</name> <rate>41.0</rate> <shippingDate>2014-05-05</shippingDate> <deliveryDate>2014-05-14</deliveryDate> <deliveryDayOfWeek>4</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <product id="3015" sequence="2"> <name>Small Packets Air</name> <rate>9.37</rate> <shippingDate>2014-05-05</shippingDate> <deliveryDate>up to 2 weeks</deliveryDate> <deliveryDayOfWeek>4</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <packing> <packingID>P_0</packingID> <box> <name>Enveloppe 9x12</name> <weight>0.37</weight> <expediterWeight>0.065</expediterWeight> <length>28.0</length> <width>20.0</width> <height>4.0</height> <packedItem> <quantity>1</quantity> <description>Online Order</description> </packedItem> </box> </packing> <shippingOptions> <insurance>No</insurance> <deliveryConfirmation>Yes</deliveryConfirmation> <signature>No</signature> </shippingOptions> <comment>* For major centres only. Add 1 to 3 business days for other destinations.</comment> </ratesAndServicesResponse> </eparcel> <!--END_OF_EPARCEL--> Quote Link to comment Share on other sites More sharing options...
magi Posted April 29, 2014 Share Posted April 29, 2014 I do have exactly the same problem with my Canada Post module. I just move up the file you posted below and retested and it did not solved the problem. I am still having.00. Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 29, 2014 Share Posted April 29, 2014 I cannot adequately test this, but please try: In the file /modules/shipping/Canada_post/shipping.class.php, near line 76:Was: $value = $option->rate; Now: $value = (float)$option->rate; Quote Link to comment Share on other sites More sharing options...
isabel-julie2 Posted April 30, 2014 Author Share Posted April 30, 2014 Thank you so much. It worked!!! Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 30, 2014 Share Posted April 30, 2014 Really? Wow! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.