VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: be on September 10, 2013, 19:42:38 PM

Title: Customfield "Date" is displaying the date of the actual day if nothing is set.
Post by: be on September 10, 2013, 19:42:38 PM
Hi,
I used a customfield Date for displaying a puplishingdate for my products.
But now I have the problem that if I have set no date in the customfield I got displayed
the date of the actual day in the tenplate.
What can I do to display a textstring or something other if noc date is set in this customfield?

Best regrads
Title: Re: Customfield "Date" is displaying the date of the actual day if nothing is set.
Post by: Maxim Pishnyak on September 12, 2013, 20:16:24 PM
Why you didn't use native publishing date of a product?
Quote from: be on September 10, 2013, 19:42:38 PM
What can I do to display a textstring or something other if noc date is set in this customfield?
Assign your custom field to a specific positions - 'date'. Then use typical construction available in default.php (productdetails) for this position
    if (!empty($this->product->customfieldsSorted['ontop'])) {
$this->position = 'date';
echo $this->loadTemplate('customfields');
    } // Product Custom ontop end
    else ........ put your code here
    ?>