Jump to content

Add delivery date to payment module


Recommended Posts

Hi everyone, i post here because i am trying to include a field in the payment module that allows the customer to choose the date of delivery or the store pick up date depending the slected metod, using the jquery script datepicker included in prestashop.

I am making tests in the bankwire module that comes with prestashop, but i think that can be incorporated in any payment module.

I xplain a bit what I'm doing.

First in the payment_execution.tpl from bankwire the bankwire module.
After de the first lines:

{capture name=path}{l s='Bank wire payment' mod='bankwire'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}



I've included a few lines to call the script,

{capture name=path}{l s='Bank wire payment' mod='bankwire'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}

<link type="text/css" rel="stylesheet" href="{$base_dir}js/jquery/datepicker/datepicker.css" />
[removed][removed]
{$datepicker}

[removed]
{literal}
   $(function() {
       $("#TRdatepicker").datepicker({
           prevText:"",
           nextText:"",
           dateFormat:"yy-mm-dd"});
   });
{/literal}
[removed]



And below, in the same file i added this lines to show the fild in the payment page.


{l s='Fecha de entrega'}
                       <input type="text" name="TRdatepicker" id="TRdatepicker" value="{$date_now}">
*



In the file AdminOrders.php located in /admin/tabs/, around the line 654 I added this:

'.$this->l('Date of delivery:').' 
'.$order->entrega.'   



Manually i created a fild in the table ps_orders with the name "delivery_date" to save the value, but i d'ont know how to store the value when click on confirm order.
Other thing is that i can't show the value in the Back Office order details (i tried this introducing manually a valuen in the database).

I include a pair of screenshots to sho how it looks.

I appreciate any help that anyone can bring me.

Best regards.

48199_dwech2bAe1Wy9eV497td_t

48200_i8WJ0C0WT7T3tVMRmJd0_t

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...