Zen Cart Logo
Forums / General Questions / expires date on product info page

expires date on product info page

Locked

Views: 2,396

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
7 Nov 2006, 10:09 AM
#1
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

expires date on product info page

I'm trying to add expires date on product info page:

 <?php echo sprintf(TEXT_DATE_END, zen_date_long($products_id[expires_date])); ?> 

this on tpl_product_info_display, and

define('TEXT_DATE_END', '<font color="#ff0000"><b>This specials end at date  %s</b></font>');

on language definition.
But, unfortunately, on product info page customer can see onlytext, without expires date.
Where I wrong?

7 Nov 2006, 10:18 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: expires date on product info page

Where is "this" coming from?:```
$products_id[expires_date]

7 Nov 2006, 10:23 AM
#3
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: expires date on product info page

It's wrong?
in special table I see this field expire_date
Help me: suggest me the code.

7 Nov 2006, 10:52 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: expires date on product info page

Specials-expiry data isn't normally available to the product-info page. To add it, you can use the following, adapted from your earlier post:

  1. keep the language-file update you suggested for TEXT_DATE_END.

  2. in tpl_product_info_display.php:

<?php if ($product_special_expires != '') echo sprintf(TEXT_DATE_END, zen_date_long($product_special_expires)); ?> 
  1. in /includes/modules/pages/product_info/main_template_vars_product_type.php
    find this line:// Nothing special to do here for primary product_info typeadd this below it:```
    $specials_query = "select expires_date
    from " . TABLE_SPECIALS . "
    where status = '1'
    and products_id = '" . $_GET['products_id'] . "'
    and ((now() <= expires_date and expires_date != '0001-01-01')
    or (now() >= specials_date_available and specials_date_available != '0001-01-01'))";

    $specials = $db->Execute($specials_query);
    $product_special_expires = ($specials->RecordCount() > 0) ? $specials->fields['expires_date'] : '';

7 Nov 2006, 1:41 PM
#5
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: expires date on product info page

You're great!
Thank's so much!

10 Nov 2006, 7:02 AM
#6
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: expires date on product info page

Do you think is this possible to do with salemaker price? I'm trying, but I can't see the solution. Can you help me?

10 Nov 2006, 11:12 AM
#7
fawzi avatar

fawzi

New Zenner

Join Date:
Apr 2006
Location:
france
Posts:
11
Plugin Contributions:
0

Re: expires date on product info page

Hi,
Thank you for this clear answer.

The display of the expires date is an important information for us (and the customers !).

I also need to display this information on sereval pages (specials sidebox, specials page and product_info page).

I think that it would be nice to display the "expires date" with the function
zen_get_products_display_price().
Perhaps with optional arguments, for displaying or not the date, and the date format.
Or perhaps with a new function (ie zen_get_products_display_price_full()) that calls zen_get_products_display_price().

Thanks again.

13 Nov 2006, 7:32 PM
#8
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: expires date on product info page

DrByte:

Specials-expiry data isn't normally available to the product-info page. To add it, you can use the following, adapted from your earlier post:

  1. keep the language-file update you suggested for TEXT_DATE_END.

  2. in tpl_product_info_display.php:

<?php if ($product_special_expires != '') echo sprintf(TEXT_DATE_END, zen_date_long($product_special_expires)); ?>
> 
> 3. in /includes/modules/pages/product_info/main_template_vars_product_type.php
> find this line:```
// Nothing special to do here for primary product_info type
```add this below it:```
    $specials_query = "select expires_date
                       from " . TABLE_SPECIALS . "
                       where status = '1' 
                       and products_id = '" . $_GET['products_id'] . "'
                       and ((now() <= expires_date and expires_date != '0001-01-01')
                             or (now() >= specials_date_available and specials_date_available != '0001-01-01'))";

    $specials = $db->Execute($specials_query);
    $product_special_expires = ($specials->RecordCount() > 0) ? $specials->fields['expires_date'] : '';

I can't find solution: I don't find the filed for salemaker expires date.
Can you help me to write expire sale date on product info page?