Results 1 to 5 of 5
  1. #1
    Join Date
    May 2009
    Posts
    30
    Plugin Contributions
    0

    Default Edit orders add on not adding download links.

    Hi,
    I wanted to use the edit orders to be able to add products to some of my orders and it works well for everything except for the download links.
    And unfortunately, i work almost only with download links. I think i came up with a solution that seems to be working, at least for now, it generates the download links in the order details. I did not add a lot to the code, and i'm not a great php coder so i may have missed some stuff (for example, i know that the table names should not be hardcoded...).

    If somebody is interested, here is the code i added (please don't just tell me that my code isn't clean, i already know that :) and maybe if you think so, then correct me :) ).

    I just edited the edit_orders.php file,
    i added this at line 478 just outside the for loop
    PHP Code:
    $result11a=mysql_query("SELECT products_attributes_filename,products_attributes_maxdays,products_attributes_maxcount FROM products_attributes_download, products_attributes 
    WHERE products_attributes.products_id= '
    $add_product_products_id
    AND products_attributes_download.products_attributes_id = products_attributes.products_attributes_id
    ORDER BY products_attributes_filename "
    )
                    or die(
    "Failed to connect database: ");
                    
    $i 1;
                    while(
    $row11a=mysql_fetch_array($result11aMYSQL_NUM)) {
                        
    $downloadnames[$i]=$row11a[0]; 
                        
    $downloaddays[$i]=$row11a[1]; 
                        
    $downloadcount[$i]=$row11a[2]; 
                        
    $i++;
                        } 
    and then this at line 550 in the for loop:
    PHP Code:
    $Query2 "insert into orders_products_download set
                    orders_id = 
    $oID,
                    orders_products_id = 
    $new_product_id,
                    download_maxdays = '" 
    $downloaddays[$i] . "',
                    download_count = '" 
    $downloadcount[$i] . "',
                    orders_products_filename = '" 
    $downloadnames[$i] . "';";
                
    $db -> Execute($Query2); 
    I know this isn't deleting any download links when you remove a product, but it seems that by default when you delete an order, it does not remove the links from the download table either...

    Maybe a coding master could correct my mistakes or this could even be usefull to someone, and even maybe added to the add on, who knows :)

    Arno
    Last edited by thysm00; 2 Jan 2010 at 02:03 AM.

  2. #2

    Default Re: Edit orders add on not adding download links.

    thysm00-

    I think I fixed this with v2.0. See the link in my signature to download it. Should take care of all issues with downloads when adding and deleting products from an order. If that doesn't work, let me know.

  3. #3
    Join Date
    May 2009
    Posts
    30
    Plugin Contributions
    0

    Default Re: Edit orders add on not adding download links.

    ..... :)
    I hope you did not fix that before me... otherwise i spent a few hours yesterday evening for nothing...
    I'll try it and tell you.

    thanks for the reply!

  4. #4
    Join Date
    May 2009
    Posts
    30
    Plugin Contributions
    0

    Default Re: Edit orders add on not adding download links.

    Well.... i just tried it and.... it's working :) And i'm sure it's way better than what i did...
    Thank you for that, and you know what's worse? I actually tried it before the v1.53 that is available in the add ons section, but i guess i did something wrong...

  5. #5
    Join Date
    May 2009
    Posts
    30
    Plugin Contributions
    0

    Default Re: Edit orders add on not adding download links.

    ...and you've got a donation!

 

 

Similar Threads

  1. v151 Admin install messages will not go away for Super Orders, Edit Orders plugins
    By rcrosier in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 15 Oct 2013, 06:10 PM
  2. edit orders add product not working
    By kzmx in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 5 Sep 2011, 05:32 PM
  3. Edit orders add on
    By NSABaits in forum All Other Contributions/Addons
    Replies: 17
    Last Post: 25 Sep 2009, 05:39 PM
  4. Updating/adding a download link in orders
    By thysm00 in forum Managing Customers and Orders
    Replies: 3
    Last Post: 27 Jul 2009, 03:50 PM
  5. Missing Download Links in Orders - How to Fix?
    By kaleya in forum Managing Customers and Orders
    Replies: 1
    Last Post: 14 Dec 2008, 07:20 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