Forums / Setting Up Categories, Products, Attributes / Problem with "Product Date Available"

Problem with "Product Date Available"

Views: 1,728

Results 1 to 16 of 16
30 Sep 2011, 12:30 PM
#1
josee225 avatar

josee225

New Zenner

Join Date:
Feb 2009
Posts:
78
Plugin Contributions:
0

Problem with "Product Date Available"

Hi,

I have products that need to be online prior to their release date. So we set them up with the planned release date, like today for instance.

But what I don't understand is that my product is still not available for purchase, even though we ARE the 30th, it still says
"Availability - 09/30/2011"

I want people to have the possibility to buy the product right now, is there any way I can fix this, short of saying my product is available on the 29th, which is absolutely not possible in our case.

URL: http://www.cartamagicastore.com/index.php?main_page=index&cPath=61_63_330_678

30 Sep 2011, 5:03 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem with "Product Date Available"

What is the Quantity set on the Product?

Do you have something customized or an add on to make the:
Availability - 09/30/2011

show on the listing and product _info page? :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Sep 2011, 7:47 PM
#3
josee225 avatar

josee225

New Zenner

Join Date:
Feb 2009
Posts:
78
Plugin Contributions:
0

Re: Problem with "Product Date Available"

Hi Linda,

I have 12 cards available in each for product quantity, and since I took over the store, I have no clue if an add-on was used.

All I can tell you is that I can enter a date right below the Product Status, as shown in the attached file.

30 Sep 2011, 9:12 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem with "Product Date Available"

Go to your Tools ... Developers Tool Kit ... and do a search in the bottom input box for:
Availability

and see if you find either the define statement for that or the code that contains that word ...

If you find the define for that you can search on that define constant and see where it is used and that might help determine where this code is that manages that display ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Sep 2011, 10:21 PM
#5
josee225 avatar

josee225

New Zenner

Join Date:
Feb 2009
Posts:
78
Plugin Contributions:
0

Re: Problem with "Product Date Available"

Ok looking for that word in Catalog, here is what I found:
english.php
Line #481 : define('BUTTON_UPCOMING_PRODUCTS_TEXT', 'Approximate availability - ');
english.php
Line #21 : define('BUTTON_UPCOMING_PRODUCTS_TEXT', 'Availability - ');

So I looked at the files in Modules, and found a file called upcoming_products.php... Apparently, there is an extra module for this!

Here is the code:

<?php
/**
 * upcoming_products module
 *
 * @package modules
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: upcoming_products.php 4162 2006-08-17 03:55:02Z ajeh $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}

$display_limit = zen_get_upcoming_date_range();
if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
/*
  $expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected
                       from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                       where to_days(products_date_available) > to_days(now())
                       and p.products_id = pd.products_id
                       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                       order by " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . "
                       limit " . MAX_DISPLAY_UPCOMING_PRODUCTS;
*/
    $expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected
                       from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                       where
                       p.products_id = pd.products_id
                       and p.products_status = 1
                       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
                       $display_limit . "
                       order by " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . "
                       limit " . MAX_DISPLAY_UPCOMING_PRODUCTS;

} else {
/*
  $expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected
                       from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
  TABLE_CATEGORIES . " c
                       where p.products_id = p2c.products_id
                       and p2c.categories_id = c.categories_id
                       and c.parent_id = '" . (int)$new_products_category_id . "'
                       and to_days(products_date_available) > to_days(now())
                       and p.products_id = pd.products_id
                       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                       order by " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . "
                       limit " . MAX_DISPLAY_UPCOMING_PRODUCTS;
*/
    $expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected
                       from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
                              TABLE_CATEGORIES . " c
                       where p.products_id = p2c.products_id
                       and p2c.categories_id = c.categories_id
                       and c.parent_id = '" . (int)$new_products_category_id . "'" .
                       $display_limit . "
                       and p.products_id = pd.products_id
                       and p.products_status = 1
                       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                       order by " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . "
                       limit " . MAX_DISPLAY_UPCOMING_PRODUCTS;

}

$expected = $db->Execute($expected_query);

if ($expected->RecordCount() > 0) {
  require($template->get_template_dir('tpl_modules_upcoming_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_upcoming_products.php');
}
?>
30 Sep 2011, 10:24 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem with "Product Date Available"

Could you now do a search on:
BUTTON_UPCOMING_PRODUCTS_TEXT

and see what files come up with that in it ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

1 Oct 2011, 12:44 AM
#7
josee225 avatar

josee225

New Zenner

Join Date:
Feb 2009
Posts:
78
Plugin Contributions:
0

Re: Problem with "Product Date Available"

Sure thing!

In Catalog:
includes/functions/functions_general.php
Line #1141 : $return_button = BUTTON_UPCOMING_PRODUCTS_TEXT . zen_date_short($button_check->fields['products_date_available']);

includes/functions_general.php
Line #1141 : $return_button = BUTTON_UPCOMING_PRODUCTS_TEXT . zen_date_short($button_check->fields['products_date_available']);

The other results are the same as above, in language files.

Nothing in Admin files.

(thank you!)

1 Oct 2011, 1:06 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem with "Product Date Available"

This file appears to be in the wrong location:
includes/functions_general.php

The other file is the one controlling that out put could you post the full function from the file:
includes/functions/functions_general.php

that that line is in?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

1 Oct 2011, 2:58 PM
#9
josee225 avatar

josee225

New Zenner

Join Date:
Feb 2009
Posts:
78
Plugin Contributions:
0

Re: Problem with "Product Date Available"

Here you go:

$button_check = $db->Execute("select product_is_call, products_quantity, products_date_available from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
    // upcoming date not available to purchase
    $upcoming_date_check = time();
    $upcoming_date_check = date('Ymd', $upcoming_date_check);
    $zc_current_date = (int)str_replace('-','',substr($button_check->fields['products_date_available'],0,10)); 
    
    switch (true) {
	case ($zc_current_date > 0 && $zc_current_date >= $upcoming_date_check):
        $return_button = BUTTON_UPCOMING_PRODUCTS_TEXT . zen_date_short($button_check->fields['products_date_available']);
        break; 
// cannot be added to the cart
    case (zen_get_products_allow_add_to_cart($product_id) == 'N'):
      return $additional_link;
      break;
    case ($button_check->fields['product_is_call'] == '1'):
      $return_button = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE . '</a>';
      break;
    case ($button_check->fields['products_quantity'] <= 0 and SHOW_PRODUCTS_SOLD_OUT_IMAGE == '1'):
      if ($_GET['main_page'] == zen_get_info_page($product_id)) {
        $return_button = zen_image_button(BUTTON_IMAGE_SOLD_OUT, BUTTON_SOLD_OUT_ALT);
      } else {
        $return_button = zen_image_button(BUTTON_IMAGE_SOLD_OUT_SMALL, BUTTON_SOLD_OUT_SMALL_ALT);
      }
      break;
    default:
      $return_button = $link;
      break;
    }
    if ($return_button != $link and $additional_link != false) {
      return $additional_link . '<br />' . $return_button;
    } else {
      return $return_button;
    }
  }
1 Oct 2011, 4:43 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem with "Product Date Available"

Did you change the dates on your site or did you find something on this? :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

1 Oct 2011, 5:13 PM
#11
josee225 avatar

josee225

New Zenner

Join Date:
Feb 2009
Posts:
78
Plugin Contributions:
0

Re: Problem with "Product Date Available"

:blink: I'm not sure what you mean?

Since we are October 1st now, the products are available for purchase. I could create a product for testing with today's date if you need.

But I did not change anything in the code, if that is your question.

1 Oct 2011, 5:35 PM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem with "Product Date Available"

Using the same Category, make 1 product September 30 and 1 product October 1 and one product October 2 ...

Then, before looking in the Catalog, go to phpMyAdmin and search the table:
products

for those products_id and see what date is in the field:
products_date_available

Then, let's go to the Catalog and see what shows ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

1 Oct 2011, 6:03 PM
#13
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem with "Product Date Available"

From what I can see you need to change this line:

    case ($zc_current_date > 0 && $zc_current_date >= $upcoming_date_check):

to read:

    case ($zc_current_date > 0 && $zc_current_date > $upcoming_date_check):

The way to test this is to go into phpMyAdmin and add the dates to the:
products_date_available

for:
2011-09-29 00:00:00
2011-09-30 00:00:00
2011-10-01 00:00:00
2011-10-02-00:00:00

What will happen now is only the 10-2 will be marked Available ...

Browsing in phpMyAdmin you will see the all of the dates ...

Edit the Product in the Admin and any that are old dates will blank out the Product Date Available on or after the expired date has happened ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

5 Oct 2011, 11:22 AM
#14
josee225 avatar

josee225

New Zenner

Join Date:
Feb 2009
Posts:
78
Plugin Contributions:
0

Re: Problem with "Product Date Available"

Hi!

Just wanted to let you know I changed the code, and now my products are now available on the release date.

Thank you!

5 Oct 2011, 1:02 PM
#15
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem with "Product Date Available"

Thanks for the update that this worked for you ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Oct 2011, 8:11 AM
#16
silkvixen avatar

silkvixen

New Zenner

Join Date:
Sep 2008
Posts:
49
Plugin Contributions:
0

Re: Problem with "Product Date Available"

did u know which add on was used - id love this on my site :)