Jump to content
xt:Commerce Community Forum

Artikel Sonderpreis Datum im Template


Recommended Posts

  • 2 years later...

Daran bin ich auch gerade, hab's bisher so gelöst:

Hook:
global $db;
$rs = $db->Execute("SELECT date_expired, status FROM ".TABLE_PRODUCTS_PRICE_SPECIAL." WHERE products_id = '".$this->data['products_id']."'");
$this->data['date_expired'] = $rs->fields['date_expired'];
$this->data['date_status'] = $rs->fields['status'];


Im Product-Template:
     {if $date_status == 1}
     <span class="product-infos"><b>{txt key=TEXT_ANGEBOT}:</b> {$date_expired}<br></span>
     {/if}

Jetzt habe ich nur noch das Problem, dass das Datum so formatiert ist wie in der DB,
also z.B.  2016-04-30 00:00:00

Hat da wer ne Lösung für mich?

Link to comment
Share on other sites

On 17.4.2016 at 0:31 AM, Jobsti said:

Im Product-Template:

     {if $date_status == 1}
     <span class="product-infos"><b>{txt key=TEXT_ANGEBOT}:</b> {$date_expired}<br></span>
     {/if}

Hallo,

{$date_expired|date_format:"%d.%m.%Y"}

sollte eigentlich gehen...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...