meanbee / magento-estimateddelivery

Magento 1 Extension to provide delivery date estimates for each shipping method.
https://www.meanbee.com/magento-extensions/estimated-delivery.html
Other
20 stars 11 forks source link

Module fails when there are more than one shipping option #7

Closed danielchicote closed 5 years ago

danielchicote commented 5 years ago

Hello, i'm trying to use meanbee shippingrules + estimateddelivery couple and it works well, but when there are more than one shipping option the checkout fails and returns the customer to the cart. The shipping rules are ok, and i have one estimated delivery for every specific option.

In my log files i can't see the reason.

punkstar commented 5 years ago

Hello - we've used this extension with more than one shipping option, so I'd be surprised if it's just that fact that's causing your issue.

In terms of debugging - take a look at the XHR request that's being fired when you save the shipping method and see if you can spot any problem there.

danielchicote commented 5 years ago

I have found that the error only happens when the store view is "spanish", the bug looks like is locale related.

DateTime::__construct(): Failed to parse time string (30/10/2018 12:13:24) at position 0 (3): Unexpected character

Trace:

0 C:\xampp\htdocs\magento\app\design\frontend\default\default\template\meanbee\estimated_delivery\checkout\onepage\shipping_method\available.phtml(47): DateTime->__construct('30/10/2018 12:1...')

1 C:\xampp\htdocs\magento\app\code\local\Mage\Core\Block\Template.php(241): include('C:\xampp\htdocs...')

2 C:\xampp\htdocs\magento\app\code\local\Mage\Core\Block\Template.php(273): Mage_Core_Block_Template->fetchView('frontend\impres...')

3 C:\xampp\htdocs\magento\app\code\local\Mage\Core\Block\Template.php(287): Mage_Core_Block_Template->renderView()

4 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(923): Mage_Core_Block_Template->_toHtml()

5 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Layout.php(555): Mage_Core_Block_Abstract->toHtml()

6 C:\xampp\htdocs\magento\app\code\core\Mage\Checkout\controllers\OnepageController.php(127): Mage_Core_Model_Layout->getOutput()

7 C:\xampp\htdocs\magento\app\code\core\Mage\Checkout\controllers\OnepageController.php(393): Mage_Checkout_OnepageController->_getShippingMethodsHtml()

8 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Checkout_OnepageController->saveBillingAction()

9 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('saveBilling')

10 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))

11 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(365): Mage_Core_Controller_Varien_Front->dispatch()

12 C:\xampp\htdocs\magento\app\Mage.php(683): Mage_Core_Model_App->run(Array)

13 C:\xampp\htdocs\magento\index.php(83): Mage::run('', 'store')

14 {main}

punkstar commented 5 years ago

Looks like you're right. Instead of passing a Zend_Date into the DateTime constructor you could format it to locale neutral format, such as Zend_Date::RFC_3339?

danielchicote commented 5 years ago

I have changed 'EEEE, dSS MMMM' to 'EEEE, d MMMM' in app\code\community\Meanbee\EstimatedDelivery\Helper\Data.php:

public function getEstimatedDeliveryFromString($shippingMethod, $date = null, $format = 'EEEE, dSS MMMM') public function getEstimatedDeliveryToString($shippingMethod, $date = null, $format = 'EEEE, dSS MMMM') public function getDispatchDateString($shippingMethod, $date = null, $format = 'EEEE, dSS MMMM')

Now it works perfect.

Great module, thanks for your work.

punkstar commented 5 years ago

I've raised #8 to permanently fix this issue, regardless of locale.