I am trying to overide a date calendar class in magento.
But when i try doing it the date input from product page disappears.
Basic i want to overide the date calendar script to add custom settings to it.
I added a hidden span to see if my changes gets out.
c3mcustommoduleModelDate
< ?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace c3mcustommoduleModel;
//namespace MagentoFrameworkViewElementHtml;
/**
* Date element block
*/
class Date extends MagentoFrameworkViewElementTemplate
{
/**
* Render block HTML
*
* @return string
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
protected function _toHtml()
{
$html = 'escapeHtml($this->getValue()) . '" ';
$html .= 'class="' . $this->getClass() . '" ' . $this->getExtraParams() . '/> ';
$calendarYearsRange = $this->getYearsRange();
$changeMonth = $this->getChangeMonth();
$changeYear = $this->getChangeYear();
$maxDate = $this->getMaxDate();
$showOn = $this->getShowOn();
$firstDay = $this->getFirstDay();
$html .= '
';
return $html;
}
/**
* Convert special characters to HTML entities
*
* @return string
*/
public function getEscapedValue()
{
if ($this->getFormat() && $this->getValue()) {
return strftime($this->getFormat(), strtotime($this->getValue()));
}
return $this->escapeHtml($this->getValue());
}
/**
* Produce and return block's html output
*
* {@inheritdoc}
*
* @return string
*/
public function getHtml()
{
return $this->toHtml();
}
}
?>
c3mcustommoduleetcdi
< ?xml version="1.0"?>
You can see at the picture i added that the calendar input is gone.