Results 1 to 5 of 5

Threaded View

  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.

 

 

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