Jump to content

[SOLVED] Datepicker problem


Recommended Posts

Hi,

 

Recently I bought the Datepicker with hours by ecommy.com

v2.3 but I'm having problems with it:

 

1. the orders icon dissapear

2.i only can see one order (the last one)

3.the one order i can see says "invalid date"

4.the configuration is fuzzy, the table goes off the boundary

 

My PrestaShop version is 1.4.8.2

 

I installed Datepicker by ftp upload of the directory Datepicker to modules, and then installed from PrestaShop backoffice. It installed ok, but when i make an order i get this problems.

 

Can someone help me?

 

Thanks in advance!

 

Please see Print Screen below.

 

http://db.tt/U7SZmsk5

Link to comment
Share on other sites

Well I start digging, and what I found:

 

The date and time for delivery are not recorded at database, and that's why it jams at last record and gives "Date invalid".

 

Analysing the code, both variables "shipping_date" and "shipping_hour" are passed from "time_interval.php" to "OrderOpcController.php" but there is no record to the database or any kind of processing.

 

Please see the code:

 

time_interval.php

 $.ajax({
  alert(shipping_date);
 type: 'POST',
 url: orderOpcUrl,
 async: false,
 cache: false,
 dataType : "json",
 data: 'ajax=true&method=updateCarrierAndGetPayments&shipping_date='+shipping_date+'&shipping_hour='+shipping_hour+'&id_carrier=' + idCarrier + '&recyclable=' + recyclablePackage + '&gift=' + gift + '&gift_message=' + giftMessage + '&token=' + static_token ,
 success: function(jsonData)
 {
   if (jsonData.hasError)
   {
 var errors = '';
 for(error in jsonData.errors)
  //IE6 bug fix
  if(error != 'indexOf')
   errors += jsonData.errors[error] + "\n";
 alert(errors);
   }
   else
   {
 updateCartSummary(jsonData.summary);
 updatePaymentMethods(jsonData);
 updateHookShoppingCart(jsonData.summary.HOOK_SHOPPING_CART);
 updateHookShoppingCartExtra(jsonData.summary.HOOK_SHOPPING_CART_EXTRA);
 $('#opc_payment_methods-overlay').fadeOut('slow');
 $('#opc_delivery_methods-overlay').fadeOut('slow');
   }
  },
 error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to save carrier \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);}
   });

 

OrderOpcController.php

  case 'updateCarrierAndGetPayments':
   if (Tools::isSubmit('id_carrier') AND Tools::isSubmit('recyclable') AND Tools::isSubmit('gift') AND Tools::isSubmit('gift_message'))
   {
    if ($this->_processCarrier())
    {
	 $return = array(
	  'summary' => self::$cart->getSummaryDetails(),
	  'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'),
	  'HOOK_PAYMENT' => $this->_getPaymentMethods()
	 );
	 die(Tools::jsonEncode($return));
    }
    else
	 $this->errors[] = Tools::displayError('Error occurred updating cart.');
    if (sizeof($this->errors))
	 die('{"hasError" : true, "errors" : ["'.implode('\',\'', $this->errors).'"]}');
    exit;
   }
   break;

 

Anyone can tell me how I record this two variables into the database?

 

Thanks

Link to comment
Share on other sites

Solution

Just copy the Datepicker class and paste to the end of Prestashop class on the following files:

Cart.php

Tools.php

Orders.php

Payment Module.php

Now records on the database

 

For tables get out of boundaries problem just edit the file AdminOrders.php and reduce width of different elements.

Now it's fine!

Link to comment
Share on other sites

  • 4 years later...

Don't buy Datepicker from Ecommy, I did, had problems, contacted them serveral times but never heard from them.

 

It is an awful feeling spending money in crappy software, boldly advertised only to piss off my customers, my customers' customers and waste other developers time.

 

Just take care of the tickets, man, or close shop completely. 

 

Hope it helps.

Link to comment
Share on other sites

×
×
  • Create New...