Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Resetting Download Links

    I need some help with something and if the answer is already here somewhere I cannot find it LOL

    When I need to reset a download link...if I click the green button to reactivate it, it gives 17 days....if I use the drop down to change the order status to Update it gives 41 days...how can I change both those values to only allow resetting to 7 days?
    Last edited by LissaE; 5 Nov 2008 at 10:50 PM. Reason: Typo :S
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Resetting Download Links

    Actually there is a little bug in the code that I am working on ...

    It should be taking the number of days of the original attribute and changing it based on the order date to be the same thing ...

    Right now, it is taking the default days for downloads and using that to change the date based on the original orders date ...

    If you look in the orders.php file in the /admin you will see where it manages the download:
    // reset single download to on
    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!

  3. #3
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Resetting Download Links

    I found that section....I have no idea what to change though to change it specifically to another 7 days LOL if it can be changed to that?

    PHP Code:
          // reset single download to on
            
    if ($_GET['download_reset_on'] > 0) {
              
    // adjust download_maxdays based on current date
              
    $check_status $db->Execute("select customers_name, customers_email_address, orders_status,
                                          date_purchased from " 
    TABLE_ORDERS "
                                          where orders_id = '" 
    $_GET['oID'] . "'");
              
    $zc_max_days date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s'time())) + DOWNLOAD_MAX_DAYS;

              
    $update_downloads_query "update " TABLE_ORDERS_PRODUCTS_DOWNLOAD " set download_maxdays='" $zc_max_days "', download_count='" DOWNLOAD_MAX_COUNT "' where orders_id='" $_GET['oID'] . "' and orders_products_download_id='" $_GET['download_reset_on'] . "'";
              
    $db->Execute($update_downloads_query);
              unset(
    $_GET['download_reset_on']);

              
    $messageStack->add_session(SUCCESS_ORDER_UPDATED_DOWNLOAD_ON'success');
              
    zen_redirect(zen_href_link(FILENAME_ORDERSzen_get_all_get_params(array('action')) . 'action=edit''NONSSL'));
            } 
    Do I just change this bit:

    PHP Code:
    $zc_max_days date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s'time())) + DOWNLOAD_MAX_DAYS
    to this:

    PHP Code:
    $zc_max_days 7
    OR
    PHP Code:
    $zc_max_days DOWNLOAD_MAX_DAYS
    Or will I be screwing it all up? LOLOL





    Last edited by LissaE; 6 Nov 2008 at 05:24 AM. Reason: To add an OR lol
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Resetting Download Links

    The $zc_max_days is how many days to set the download_maxdays so that downloads can continue ...

    The calculation is taking the date_purchased to the current date and resetting the number of days to what it would take to allow the new number of days to give, for example, 7 days if the DOWNLOAD_MAX_DAYS is set to 7 ...

    This is set on the Configuration ... Attribute Settings ...
    Download Expiration (Number of Days)
    Set number of days before the download link expires. 0 means no limit.
    This means if the order was placed on October 1st and the download was good for 7 days ... then you reset it on the 15th to give 7 days, the number of days would be changed to 22 days so that from the 15th there were 7 days left to download ...
    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. #5
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Resetting Download Links

    I understand that...or I think I do LOL

    I tried changing it to $zc_max_days = DOWNLOAD_MAX_DAYS; and while that did actually work to reset it to another 7 days only....the yellow button failed to become green and any attempt to click on it after just told me the it had been reset, wouldn't disable it back again lol so I don't know where to go from here except to wait until my head and eyes might be fresher and try again LOL
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Resetting Download Links

    The button is more like a toggle ...

    Green for Available for Download
    Yellow for disabled
    Red for filename cannot be downloaded

    If you click the Green button you cannot download and it will be marked Yellow ...

    If you click the Yellow button you can download and it will be marked as Green ...

    If you see the Red button, then you need to check the filename on the Attribute and make sure that it is on the server ...

    Keep in mind, adding 7 days to an old order is not enough ...

    The reason it is setup with the original calculation is to give the number of extra days needed from the Order Date to allow for a new "7" days or whatever setting there is ...

    So if I make an Order today ... and get it to process ... then go into phpMyAdmin and change the Order Date to October 6th, the Download is unavailable and I will see Yellow on the Order ...

    If I click the Yellow button it will change the settings on the Attribute to be Green and I will now see 38 days ... as October 6th to 7 days from now is 38 days ...

    If you change the formula to just be 7 days, then it is still expired based on the Order date ...

    I think the original code is correct and it is just the display of the number of days confusing you as you are not taking into account how many days are needed from Order Date to give the New 7 days for the Download ...
    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!

  7. #7
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Resetting Download Links

    ahhhh I understand now thanx LOL sometimes I need to have it banged into my head LOL!
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

  8. #8
    Join Date
    Mar 2009
    Posts
    11
    Plugin Contributions
    0

    Default Re: Resetting Download Links

    is there an easy way to reset the downloads without having to toggle each and every one of them. Because our store is fully digital products an order could have 100 download files and it would take forever to reset everything?

  9. #9
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Resetting Download Links

    Yep there is, if you scroll down to the bottom underneath the download listing, there's a drop down box next to Status: change that to Updated and click the Update button...unless you remove the tick in the box next to notify customer, this will also notify your customer that the downloads have been reset and the order updated.

    I also changed mine to say Reset instead of Updated in Admin - Localization - Orders Status since we also only do downloadable products :)
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

 

 

Similar Threads

  1. links are resetting ZENID and loosing login or shopping cart
    By vandiermen in forum General Questions
    Replies: 5
    Last Post: 20 May 2011, 07:54 PM
  2. Download links do not appear
    By Sandy K in forum Managing Customers and Orders
    Replies: 2
    Last Post: 30 Sep 2010, 07:31 PM
  3. No Download Links
    By EdelineM in forum Basic Configuration
    Replies: 0
    Last Post: 14 May 2008, 09:27 PM

Posting Permissions

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