osCmax v2.5 User Manual
Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Downloadable products issue

This is a discussion on Downloadable products issue within the osCMax v2 Features Discussion forums, part of the osCmax v2.0 Forums category; Hi there! After checking out (after payment) and when you visit the order history for downloadable products, i get the ...

      
  1. #1
    New Member
    Join Date
    Oct 2009
    Posts
    15
    Rep Power
    0


    Default Downloadable products issue

    Hi there!
    After checking out (after payment) and when you visit the order history for downloadable products, i get the error message

    Warning: mktime() expects parameter 6 to be long, string given in /home/u4528180/domains/hhmedia.se/public_html/oscmax/includes/modules/downloads.php on line 48

    The expire date automaticly sets to thursday 01 january 1970, and no download link or button shows. What am I dooing wrong here?

    The only thing I can think of is that I have two product attributes (one year support and no support), but could that really be the source of my problem.

    Really thankful for any hint about this!

    /Tobias Henricsson

  2. #2
    osCMax Development Team
    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    3,014
    Rep Power
    36


    Default Re: Downloadable products issue

    Please state which version of oscMax that you running, it should help to diagnose the issue.
    [Sorry, unable to assist on specific problem].
    Hosting plans with installation, configuration, contributions, support and maintenance.

  3. #3
    New Member
    Join Date
    Oct 2009
    Posts
    15
    Rep Power
    0


    Default Re: Downloadable products issue

    Hi again!
    Thanks for your answer! I'm running version 2.0.3, if that can be of any help...

  4. #4
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Smile Re: Downloadable products issue

    Line 48 in downloads.php is

    Code:
          $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);
    The 6th parameter is the $dt_year which is set from line 47

    list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']);
    Have you got the date and time set on your server?

    Have a look through myPhpAdmin at the ORDERS_PRODUCTS_DOWNLOAD table to see what dates are being stored.

    Check the settings of Configuration --> Download against the Wiki
    pgmarshall
    _______________________________

  5. #5
    New Member
    Join Date
    Oct 2009
    Posts
    15
    Rep Power
    0


    Default Re: Downloadable products issue

    Once again, thanks for your answer!

    the date settings seems to ber correct. Here is the values from the server:
    Server OS: Linux 2.6.18-6-686
    Database: MySQL 5.0.81
    Server Date: 10/30/2009 10:46:20
    Datebase Date: 10/30/2009 10:46:20
    HTTP Server: Apache/2
    PHP Version: 5.2.11 (Zend: 2.2.0)

    And here is the values from orders_product_download:
    Code:
    Fält                                        Typ      Funktion      Null      Värde
    orders_products_download_id      int(11)                              6             
    orders_id                                 int(11)                              1
    orders_products_id                    int(11)                              3
    orders_products_filename           varchar(255)             TU2009TrialEN-US.exe
    download_maxdays                   int(2)                               30
    download_count                       int(2)                               5
    (The Function and Null fields are empty, tried to tab/space the text here in the post)

    Any clues?

    Edit: Forgot to say that the download settings in the admin page seems to be just fine.

    /Tobias Henricsson
    Last edited by henricsson; 10-30-2009 at 02:04 AM.

  6. #6
    New Member
    Join Date
    Oct 2009
    Posts
    15
    Rep Power
    0


    Default Re: Downloadable products issue

    Sorry for bugging you, but do you have any updates on this?

    Thanks!

    /Tobias Henricsson

  7. #7
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Default Re: Downloadable products issue

    The expire date automaticly sets to thursday 01 january 1970
    Do you change this before saving?
    pgmarshall
    _______________________________

  8. #8
    New Member
    Join Date
    Oct 2009
    Posts
    15
    Rep Power
    0


    Default Re: Downloadable products issue

    Hi again!
    Here are a few screenshots of the error (my translations in red). Hope it can bring some light to this...

    from_database.jpg = The posts in phpmyadmin in my database
    prod_attrib.jpg = Product attributes from the admin page --> Product attributes.
    screen_error.jpg = The screenshot from the error itself.

    /Tobias Henricsson
    Attached Images Attached Images

  9. #9
    osCMax Development Team
    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    3,014
    Rep Power
    36


    Lightbulb Re: Downloadable products issue

    It appears, at 1st glance, that the date may be in the wrong format.
    Edit download.php and insert an echo just prior to line 48, that echos parameter 6.
    Lines 48-49
    PHP Code:
    echo $dt_year;
          
    $download_timestamp mktime(235959$dt_month$dt_day $downloads['download_maxdays'], $dt_year); 

    That way you can at least identify what is attempting to be passed to the mktime function. I'll hazard a guess that it displays only a two digit year and not four digits but you just never know.

    EJ
    Last edited by ridexbuilder; 11-09-2009 at 04:48 AM.
    Hosting plans with installation, configuration, contributions, support and maintenance.

  10. #10
    New Member
    Join Date
    Oct 2009
    Posts
    15
    Rep Power
    0


    Default Re: Downloadable products issue

    Thanks for your answer! My line 48-49 looh like this in oscmax/download.php:

    Code:
      for ($i = 1; $i <= $length; $i++) {
       $q = floor(tep_rand(1,26));
    The closest to your suggestion I can find is line 26-28:

    Code:
    // MySQL 3.22 does not have INTERVAL
      list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']);
      $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);
    Can I "echo" this one instead? Are we maybe on different versions?

    Thanks!

    /Tobias Henricsson

Page 1 of 3 123 LastLast

Similar Threads

  1. Downloadable Products Question
    By minuteman1970 in forum osCommerce 2.2 Discussion
    Replies: 4
    Last Post: 09-26-2007, 04:12 PM
  2. Emergency problem with downloadable products -- IE Windows
    By gheffron in forum osCmax v2 Installation issues
    Replies: 7
    Last Post: 04-27-2007, 08:40 PM
  3. Downloadable products not downloading
    By iluminada in forum osCmax v2 Installation issues
    Replies: 3
    Last Post: 11-29-2005, 06:49 PM
  4. AutoGenerating Authorization for Downloadable products ?
    By zonzo_1 in forum osCMax v1.7 General Mods Discussion
    Replies: 0
    Last Post: 11-09-2005, 07:33 AM
  5. DOWNLOADABLE PRODUCTS - EXPIRY DAYS BUG - Probably!!!
    By norb in forum osCmax v1.7 Discussion
    Replies: 6
    Last Post: 03-29-2004, 09:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •