Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2009
    Posts
    6
    Plugin Contributions
    0

    Default Updating "Everyone's" downloads at once

    zen cart v1.5.5.a

    I just updated all our download products.
    These download products go back to 2008, back when everything was 7 days and 5 attempts (now 0 and 10 attempts the past several years) many many many purchases ago

    The problem is - Soon as I announce all our download products has been updated, we're going to get flooded with a bunch of emails requesting their downloads be reset.

    It would be really nice if I could update/reset "everyone's" downloads with a few clicks - and then make the announcement (also adding everyone can go into their account a re-download their products.


    Fingers crossed this is possible

    Thanks, Aaron

  2. #2
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Updating "Everyone's" downloads at once

    So there is a database modification that can be done to reset everyone to be able to download regardless of the previous purchase date, but one thing needed to support the 10 day part is to actually change the date of the purchase so that 10 days still exists from the point of "release". There is also a code modification/addition that could be done to support the operation. Thinking something like a start date that could be used in place of the existing database date as a "temporary" reset of the clock making it seem like everyone had purchased on the same day and for those product with limited duration that date would be used for operation.

    So the information of importance is held in two tables: orders_products_downloads has your number of downloads remaining assuming that also was a factor as well as the number of days through which the download(s) can be made for that order. And orders has the date of purchase which is used against the number of allowable days if that is not 0.

    My recommendation would be to keep the order history as it is/was and use some extra code (maybe an observer) to address the "extension" of the purchase date. Basically if the purchase date is before your "start" date and the number of days is limited then consider the comparison date as the start date. That way new purchases do not get pushed into the past and the extra code could be removed (or become useless) after the duration of the longest allowable access date following the start date. This way the purchase history isn't modified it is just the "allowance" history. Though I would think if the modifications to the database were made through tools-install sql patches at least there would be a logged history of what happened for ZC 1.5.4 and newer.

    The fields in question:
    Table: orders_products_downloads
    Fields: download_maxdays (number of days following purchase during which product can be downloaded)
    download_count (number of downloads remaining available until can not download further).

    Table: orders
    Field: date_purchased
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Updating "Everyone's" downloads at once

    Quote Originally Posted by mc12345678 View Post
    ... but one thing needed to support the 10 day part is to actually change the date of the purchase so that 10 days still exists from the point of "release".
    @mc12345678 am I correct in interpreting this as you thought the OP said "10 days" instead of "0 days and 10 times"?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Updating "Everyone's" downloads at once

    Quote Originally Posted by DrByte View Post
    @mc12345678 am I correct in interpreting this as you thought the OP said "10 days" instead of "0 days and 10 times"?
    You are correct about my mis-interpretation of the expected condition.

    The current "plan" of 0 days and 10 downloads is way easier to address than all the other stuff I put out there. Guess I was "over posting" for others that wanted to do more than what was specifically requested by the OP.

    Two fields to adjust, both in the orders_products_downloads table, single sql:

    Code:
    update orders_products_downloads set download_maxdays = 0, download_count = 10;
    That will update all records of those items purchased regardless of when purchased to be limitless on time, but limited by frequency of download. Something similar may be needed for product that are now available/or yet to be purchased.
    Last edited by mc12345678; 27 Apr 2017 at 05:05 AM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Replies: 7
    Last Post: 7 Feb 2011, 09:22 PM
  2. "we are not shipping to your region at this time" once weight > max
    By Chandy in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 8 Feb 2010, 09:53 PM
  3. Replies: 0
    Last Post: 8 Feb 2010, 12:43 AM
  4. Downloads: 0 for unlimited, leaves weird characters in "my account" for "remaining"
    By Elarya in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 22 Mar 2008, 04:06 AM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR