Add Promotion "from - To" Date In Product_Templates

{* Start Timer }

{if $product.discount}





{/if}

{
/End Timer *}



this code work only on “customer/views/promotions/list.tpl”

{foreach from=$promotions key="promotion_id" item="promotion"}{$promotion.to_date|date_format:"%d-%H:%M:%S"}{/foreach}



the code do not work in “skins/basic/customer/blocks/product_templates/default_long_options_template.tpl”



please help me with tutorial for running the code on this template!



thanks all

if this code is executed in the desired format, if the promotion is active in four out of every four on the show.

what should i call on the same product promotion?





if load

dispatch=products.view&product_id=XX





fetch only active promotion for current product id “XX {$promotion.to_date}” & “XX {…from_date}”



I do not understand the explanation

I'm do not know the use of Smarty template codes!



i did it this way:

{capture name="promotions"}{include file="views/promotions/list.tpl" show="$promotion.to_date"}{/foreach}{$smarty.capture.promotions}





but the result was this:

```php

Currently not available promotions


```

[color=#ff0000][b]while the product is activated promotion![/b][/color]
Do not need to use the module and the hook? If you can help it. But if you do not! So how did you? [b]I'm confused[/b]

The above code you entered was incorrect. Was corrected!

{capture name="promotions"}{include file="views/promotions/list.tpl" show="$promotion.to_date"}{/capture}{$smarty.capture.promotions}



Just because you do not make mistakes! Sorry of all

of friends! who can get help?

create func.php in addons/my_change folder and import code:

```php

if ( !defined('AREA') ) { die('Access denied'); }
function fn_my_changes_get_promotions($to_date){
return $to_date;
}
?>

```



import code in basic/customer/blocks/product_templates/default_long_options_template.tpl:


{$promotion.to_date|fn_my_changes_get_promotions}




but do not function code from row “to_date” in “promotions” table database

Capable people are here! I'm surprised! Why these people can make someone happy with a small and short answer and tie him to the problem, do not hesitate!



It is not my intention to disrespect anyone. I just want the problem to be solved.



thanks all.

hi



i create “to_date.tpl” in “static_templates” and insert the code:


{foreach from="promotions" key="promotion_id" item="promotion" name="promotion"}{if $smarty.foreach.promotion.first}{$promotion.to_date|date_format:"%d-%H:%M:%S"|unescape:javascript}{/if}{/foreach}




and including “to_date.tpl” file into “default_long_options_template.tpl”, but this will output current time “01-17:35:45”

But I've set the date of promotion to 2 days later!!

hi all



For more obvious problem, please note this picture: