Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Date Picker in Customer Zone

 
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 03-02-2018, 08:34 AM
 
Soptareanu Alex Soptareanu Alex is offline
 

Member
  
Join Date: Sep 2016
Posts: 24
 

Default Date Picker in Customer Zone

Hello. I need to include datepicker plugin into my customer zone, in order to show a calendar intro checkout page.
This is my View Class :
<?php
// vim: set ts=4 sw=4 sts=4 et:

/**
* Copyright (c) 2011-present Qualiteam software Ltd. All rights reserved.
* See https://www.x-cart.com/license-agreement.html for license details.
*/

namespace XLite\Module\XGhosty\Disponibility\View\Checkout;

use \XLite\Core\Database as _Db;

/**
* Cart items
*
* @ListChild (list="checkout.shipping.selected.sub.payment", weight="1000", zone="customer")
*/

class Calendar extends \XLite\View\AView
{
/**
* Return widget default template
*
* @return string
*/
protected function getDefaultTemplate()
{
return 'modules/XGhosty/Disponibility/checkout/calendar.twig';
}

/**
* Register CSS files
*
* @return array
*/
public function getCSSFiles()
{
$list = parent::getCSSFiles();
$list[] = 'modules/XGhosty/Disponibility/assets/css/jquery.datepick.css';

return $list;
}

/**
* Get JS files
*
* @return array
*/
public function getJSFiles()
{
$list = parent::getJSFiles();
$list[] = 'modules/XGhosty/Disponibility/assets/js/jquery.plugin.min.js'; // Aici imi pun js-urile mele
$list[] = 'modules/XGhosty/Disponibility/assets/js/jquery.datepick.min.js'; // Aici imi pun js-urile mele

return $list;
}

/**
* Get cart items
*
* @return array
*/
public function getItems()
{
return $this->getCart()
? $this->getCart()->getItems()
: [];
}
}

The problem is that .js and .css resources didn't load in my layout.
This is my twig file :
{% if this.showDeliveryDate() is not null %}
<div>
<span> Delivery date is : <b> {{ this.showDeliveryDate() }} </b> </span>
</div>
{% endif %}
<script>

$(function(){
console.log("asd");
});

$(document).ready(function(){
$('#defaultPopup').datepick({minDate: new Date(2014, 12-1, 25)}); // This is how I want to init my plugin in page !!
});
__________________
alex
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:34 PM.

   

 
X-Cart forums © 2001-2020