Jump to content
xt:Commerce Community Forum
dietodeskralle

Artikel Sonderpreis Datum im Template

Recommended Posts

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?

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...