Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Downloads Controller v5.3 with Free Ship/Pay


Ajeh

Recommended Posts

If I patch the download.php file, will I have to edit any other files?

 

Also, will these fix my download link problem? I'm using Download Controller v5.3, and the download directory is protected. I put in the product attribute for the file, the attribute name is Download, and for the download link, I just put in the filename, but the download link still doesn't download properly.

 

The download link in the order history page is calling for the right file, but it's calling for the file from the pub/.bunchofletters/file.zip when the file.zip is stored in the download folder.

 

That's the only thing wrong with the download.

Link to comment
Share on other sites

  • Replies 264
  • Created
  • Last Reply

Top Posters In This Topic

I can't get this contribution or downloads in general to work at all. I've looked at the download documentation in the knowledge base but it's not helpfull. And the readme.txt file with this contribution is no help either.

 

Does anyone know if there is better documentation that fully describes the steps needed to setup a product as a downloadable?

Link to comment
Share on other sites

I can't get this contribution or downloads in general to work at all.  I've looked at the download documentation in the knowledge base but it's not helpfull.  And the readme.txt file with this contribution is no help either.

 

Does anyone know if there is better documentation that fully describes the steps needed to setup a product as a downloadable?

 

what is the problem with your installation? I managed to get everything working except the actual download link, which is the most important thing but still haven't found a fix to. State your problem and we'll see what we can do about it.

Link to comment
Share on other sites

what is the problem with your installation?  I managed to get everything working except the actual download link, which is the most important thing but still haven't found a fix to.  State your problem and we'll see what we can do about it.

 

I got it working now. Thanks for the offer to help however. After reading as much as possible on it, I figured out for the link to show up you need all these things to be true:

 

1) The contrib is Enabled (duh). All the other settings are setup correctly, etc.

 

2) You must have at least one product Attribute setup in Catalog > Product Attributes and applied to your product(s). I used phpMyAdmin to do this quickly for all my products using an UPDATE query instead of doing it one by one.

 

3) Then for each product you want a download for, in Catalog > Product Attributes scroll to the bottom of the screen and do these 4 things (for each product that will have a download):

 

a) Select the product to setup a download for from the dropdown box at the bottom.

 

B) Select the product attribute from the dropdown box that you want to associate the download to. For example, I named mine "File Download". You can have several attributes. I just have one however.

 

c) Specify the filename of the download on the line below the attributes box. Example: mygreatpic.jpg

 

d) Upload mygreatpic.jpg to your Catalog/Download folder.

 

That's it! :) Good luck

Link to comment
Share on other sites

Can't get downloads to work. I get the following message

Warning: main(includes/boxes/downloads.php): failed to open stream: No such file or directory in

 

 

Is there supposed to be a file called downloads.php in catalog/includes/boxes? Because is there is, I don't have it.

 

I get the same error, anyone else?

 

Warning: main(includes/boxes/downloads.php): failed to open stream: No such file or directory in /home/solution/public_html/account_history_info.php on line 263

 

Im gonna check any back contrib. releases for this file....

Link to comment
Share on other sites

I get the same error, anyone else?

 

Warning: main(includes/boxes/downloads.php): failed to open stream: No such file or directory in /home/solution/public_html/account_history_info.php on line 263

 

Im gonna check any back contrib. releases for this file....

 

 

Ok here we go...

 

account_history_info.php, line 263 edit:

<?php
 if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_BOXES . 'downloads.php');
?>

 

<?php
 if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php');
?>

Link to comment
Share on other sites

I'm trying to install the Downloads Controller but it requires me to overwrite my already altered (Auth.net 1.7 contrib) checkout_process.php file. I know that I cannot overwrite this file as it's needed to be in it's current form for the Auth.net module to work properly. I've been trying to add the changes that the downloads controller makes with no luck as there are many small changes and differences I'm not sure about.

 

Is anyone successfully using the downloads controller with the newest Authorize.net 1.7 consolidation contribution?

 

If so, would you mind posting your edited Authorize.net (with download controller addition) catalog/checkout_process.php file?

 

Thanks for any possible help!

Ed

Edited by NiceGuyEd
Link to comment
Share on other sites

To be honest, installing this contrib is a BITCH. It's one of the hardest I've done.

 

The reason it is, is that you have to compare each file that needs to be modified, and then carefully make the changes. There are no instructions like most contribs that tell you the line to find and then what to replace it with or add above or below. Comparing highly modified files (like mine are) is not as easy as you think. I have a LOT of experience using file Diff programs, and it can be tricky with a lot of mods. You have to be VERY CAREFULL.

 

I almost gave up on it, because it was so time consumming. But I need this contrib so much, I kept at it. I was sure while doing it that I would make a mistake and have to start over, but believe it or not, it worked perfectly the first time! :)

 

I think most people ignore the "backup your files first" stuff you read in the readme files (I do most of the time), but with this one, you absolutely have to or you may regret it.

Link to comment
Share on other sites

I've got the contribution installed and am receiving the following error upon finishing the checkout process:

 

Parse error: parse error, unexpected $ in /home/httpd/vhosts/lsmedia.biz/httpdocs/checkout_process.php on line 310

 

Here's line 299 to 310 of my checkout_process.php file.

// unregister session variables used during checkout
 tep_session_unregister('sendto');
 tep_session_unregister('billto');
 tep_session_unregister('shipping');
 tep_session_unregister('payment');

 tep_session_register('last_order');
 $last_order = $insert_id;

 tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));

 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

Could someone give me some assistance with this? :(

Link to comment
Share on other sites

Line 310 seems to be the last "?>" line in the file, right?

 

When an error message states that the last line in a file is problem and the last line clearly isn't the problem, it indicates that the problem is above that. The processing gets confused and mentions the last line because it can't pinpoint the real line that is causing the problem.

 

You have to look above that, and look for a "$" (dollar sign) that is out of place. Compare this file to your backup file using a Diff program, and look for an extra "$" in the new file. You did make a backup of the file first didn't you? :) If you didn't it will be hard to tell the changes you made, and much harder to find the problem.

Edited by ChrisW123
Link to comment
Share on other sites

Yes, I've got everything backed up.

 

I've scoured the new file and can't seem for the life of me to be able to find the problem.

 

Here's the new file if anyone would mind having a look.

 

<?php
/*
This file has been modified combining Auth.net and downloads controller checkout process files.
*/

 include('includes/application_top.php');

// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }
 
 if (!tep_session_is_registered('sendto')) {
   tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
 }

 if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {
   tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}

// avoid hack attempts during the checkout procedure by checking the internal cartID
 if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
   if ($cart->cartID != $cartID) {
     tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
   }
 }

 include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);

// load selected payment module
 require(DIR_WS_CLASSES . 'payment.php');
 $payment_modules = new payment($payment);

// load the selected shipping module
 require(DIR_WS_CLASSES . 'shipping.php');
 $shipping_modules = new shipping($shipping);

 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;

// load the before_process function from the payment modules
 $payment_modules->before_process();

//************************************************************
// Authorizenet ADC Direct Connection
//************************************************************

 require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;

 $order_totals = $order_total_modules->process();

// BOF: WebMakers.com Added: Downloads Controller
$sql_data_array = array('customers_id' => $customer_id,
                         'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
                         'customers_company' => $order->customer['company'],
                         'customers_street_address' => $order->customer['street_address'],
                         'customers_suburb' => $order->customer['suburb'],
                         'customers_city' => $order->customer['city'],
                         'customers_postcode' => $order->customer['postcode'], 
                         'customers_state' => $order->customer['state'], 
                         'customers_country' => $order->customer['country']['title'], 
                         'customers_telephone' => $order->customer['telephone'], 
                         'customers_email_address' => $order->customer['email_address'],
                         'customers_address_format_id' => $order->customer['format_id'], 
                         'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], 
                         'delivery_company' => $order->delivery['company'],
                         'delivery_street_address' => $order->delivery['street_address'], 
                         'delivery_suburb' => $order->delivery['suburb'], 
                         'delivery_city' => $order->delivery['city'], 
                         'delivery_postcode' => $order->delivery['postcode'], 
                         'delivery_state' => $order->delivery['state'], 
                         'delivery_country' => $order->delivery['country']['title'], 
                         'delivery_address_format_id' => $order->delivery['format_id'], 
                         'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 
                         'billing_company' => $order->billing['company'],
                         'billing_street_address' => $order->billing['street_address'], 
                         'billing_suburb' => $order->billing['suburb'], 
                         'billing_city' => $order->billing['city'], 
                         'billing_postcode' => $order->billing['postcode'], 
                         'billing_state' => $order->billing['state'], 
                         'billing_country' => $order->billing['country']['title'], 
                         'billing_address_format_id' => $order->billing['format_id'], 
                         'payment_method' => $order->info['payment_method'], 
                         'cc_type' => $order->info['cc_type'], 
                         'cc_owner' => $order->info['cc_owner'], 
                         'cc_number' => $order->info['cc_number'], 
                         'cc_expires' => $order->info['cc_expires'], 
                         'date_purchased' => 'now()', 
                         'last_modified' => 'now()',
                         'orders_status' => $order->info['order_status'], 
                         'currency' => $order->info['currency'], 
                         'currency_value' => $order->info['currency_value']);
// EOF: WebMakers.com Added: Downloads Controller

 tep_db_perform(TABLE_ORDERS, $sql_data_array);
 $insert_id = tep_db_insert_id();
 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {

// Make sure the /catalog/includes/class/order.php is included
// and $order object is created before this!!!
if(MODULE_PAYMENT_AUTHORIZENET_STATUS) {
 include(DIR_WS_MODULES . 'authorizenet_direct.php');
}

//************************************************************

// load the before_process function from the payment modules
 $payment_modules->before_process();
 for ($i=0; $i<sizeof($order_totals); $i++) {
   $sql_data_array = array('orders_id' => $insert_id,
                           'title' => $order_totals[$i]['title'],
                           'text' => $order_totals[$i]['text'],
                           'value' => $order_totals[$i]['value'], 
                           'class' => $order_totals[$i]['code'], 
                           'sort_order' => $order_totals[$i]['sort_order']);
   tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
 }

$customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
 $sql_data_array = array('orders_id' => $insert_id, 
                         'orders_status_id' => $order->info['order_status'], 
                         'date_added' => 'now()', 
                         'customer_notified' => $customer_notification,
                         'comments' => $order->info['comments']);
 tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);

// initialized for the email confirmation
 $products_ordered = '';
 $subtotal = 0;
 $total_tax = 0;

 for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
// Stock Update - Joao Correia
   if (STOCK_LIMITED == 'true') {
     if (DOWNLOAD_ENABLED == 'true') {
       $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename 
                           FROM " . TABLE_PRODUCTS . " p
                           LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                            ON p.products_id=pa.products_id
                           LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
                            ON pa.products_attributes_id=pad.products_attributes_id
                           WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
// Will work with only one option for downloadable products
// otherwise, we have to build the query dynamically with a loop
       $products_attributes = $order->products[$i]['attributes'];
       if (is_array($products_attributes)) {
         $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
       }
       $stock_query = tep_db_query($stock_query_raw);
     } else {
       $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
     }
if (tep_db_num_rows($stock_query) > 0) {
       $stock_values = tep_db_fetch_array($stock_query);
// do not decrement quantities if products_attributes_filename exists
       if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {
         $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
       } else {
         $stock_left = $stock_values['products_quantity'];
       }
       tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
       if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
         tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
       }
     }
   }

// Update products_ordered (for bestsellers list)
   tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

   $sql_data_array = array('orders_id' => $insert_id, 
                           'products_id' => tep_get_prid($order->products[$i]['id']), 
                           'products_model' => $order->products[$i]['model'], 
                           'products_name' => $order->products[$i]['name'], 
                           'products_price' => $order->products[$i]['price'], 
                           'final_price' => $order->products[$i]['final_price'], 
                           'products_tax' => $order->products[$i]['tax'], 
                           'products_quantity' => $order->products[$i]['qty']);
   tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
   $order_products_id = tep_db_insert_id();

//------insert customer choosen option to order--------
   $attributes_exist = '0';
   $products_ordered_attributes = '';
 if (isset($order->products[$i]['attributes'])) {
     $attributes_exist = '1';
     for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
       if (DOWNLOAD_ENABLED == 'true') {
         $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename 
                              from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa 
                              left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
                               on pa.products_attributes_id=pad.products_attributes_id
                              where pa.products_id = '" . $order->products[$i]['id'] . "' 
                               and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' 
                               and pa.options_id = popt.products_options_id 
                               and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' 
                               and pa.options_values_id = poval.products_options_values_id 
                               and popt.language_id = '" . $languages_id . "' 
                               and poval.language_id = '" . $languages_id . "'";
         $attributes = tep_db_query($attributes_query);
       } else {
         $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
       }
       $attributes_values = tep_db_fetch_array($attributes);

       $sql_data_array = array('orders_id' => $insert_id, 
                               'orders_products_id' => $order_products_id, 
                               'products_options' => $attributes_values['products_options_name'],
                               'products_options_values' => $attributes_values['products_options_values_name'], 
                               'options_values_price' => $attributes_values['options_values_price'], 
                               'price_prefix' => $attributes_values['price_prefix']);
       tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);

       if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {
         $sql_data_array = array('orders_id' => $insert_id, 
                                 'orders_products_id' => $order_products_id, 
                                 'orders_products_filename' => $attributes_values['products_attributes_filename'], 
                                 'download_maxdays' => $attributes_values['products_attributes_maxdays'], 
                                 'download_count' => $attributes_values['products_attributes_maxcount']);
         tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
       }
       $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
     }
   }
//------insert customer choosen option eof ----
   $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
   $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
   $total_cost += $total_products_price;

   $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
 }

// lets start with the email confirmation
 $email_order = STORE_NAME . "\n" . 
                EMAIL_SEPARATOR . "\n" . 
                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
                EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
 if ($order->info['comments']) {
   $email_order .= tep_db_output($order->info['comments']) . "\n\n";
 }
 $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . 
                 EMAIL_SEPARATOR . "\n" . 
                 $products_ordered . 
                 EMAIL_SEPARATOR . "\n";

 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
   $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
 }

 if ($order->content_type != 'virtual') {
   $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . 
                   EMAIL_SEPARATOR . "\n" .
                   tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
 }

 $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
                 EMAIL_SEPARATOR . "\n" .
                 tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
 if (is_object($$payment)) {
   $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . 
                   EMAIL_SEPARATOR . "\n";
   $payment_class = $$payment;
   $email_order .= $payment_class->title . "\n\n";
   if ($payment_class->email_footer) { 
     $email_order .= $payment_class->email_footer . "\n\n";
   }
 }
 tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// send emails to other people
 if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
   tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
 }

// load the after_process function from the payment modules
 $payment_modules->after_process();

 $cart->reset(true);

// unregister session variables used during checkout
 tep_session_unregister('sendto');
 tep_session_unregister('billto');
 tep_session_unregister('shipping');
 tep_session_unregister('payment');
 tep_session_unregister('comments');

 tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));

 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Link to comment
Share on other sites

drat..

 

been at this forever with no results. :(

 

Is anyone using the Authorize.net 1.7 consolidation contribution along with this downloads controller?

 

Would you mind sharing your checkout_process.php file?

 

I'm afraid I'm never going to be able to successfully combine these myself.

Link to comment
Share on other sites

Hi Chris.

Yes, that's what I did. I found one other instance of it. I edited it and uploaded; however, I'm still getting the parse error.

 

Since installing this controller, I'm also now noticing that when I go to my test product in my admin (which is a .zip file of a web template), I'm seeing an error stating:

Fatal error: Call to undefined function: tep_get_products_master_status() in /home/httpd/vhosts/lsmedia.biz/httpdocs/admin/categories.php on line 1737

 

Here's line 1736-1741 in my admin/categories.php file:

//Master Products
           if (tep_get_products_master_status($pInfo->products_id) !=1) {
           $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_product') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
         } else {
           $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_master') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');         	 
         }

Any ideas? :(

Edited by NiceGuyEd
Link to comment
Share on other sites

Hmm, not sure why you are still getting the parse error "unexpected $" still. You may need to compare the files. Do you have a file diff comparison program? If so, you can compare the original file (which worked, I'm assuming) and this new one which doesn't. Doing this will narrow down where the problem is.

 

As for the other error "Call to undefined function: tep_get_products_master_status() " it means that function doesn't exist. That function looks like it would have came with the "Master Products" contribution? I don't use this contrib so I don't know about it.

 

Do a file diff comparison on /includes/functions/general.php and on admin/includes/functions/general.php also. These .php files contain the various functions. Maybe when you were installing the Download Controller contrib, you deleted tep_get_products_master_status() by accident.

 

Your system sounds really messed up. If you can't find the problem by looking at the files above, I would restore the files you modified and start over.

Link to comment
Share on other sites

Thanks again for your reply Chris.

 

Yes I have a compare program. The original file which worked is the authorize.net 1.7 supplied checkout_process.php file. I think this is my big problem. Replacing this file with the Download Controller's checkout_process.php file is obviously going to make my Authorize.net checkout no longer work; however, the Download Controller can't run without it's supplied checkout_process.php file. I've been trying to combine these 2 files into one checkout_process.php file for about a week now with no success... mostly due to my lack of php experience.

 

Restoring my system to the previous state without the Download Controller doesn't seem like it will do a whole lot of good as I'm still going to run into the exact same problem of combining the 2 checkout_process.php files.

 

Surely someone is using the Authorize.net contribution and the Download Controller contribution together successfully!? If anyone is and is reading this, please share your checkout_process.php file with me... it would be so much appreciated!!! :)

 

Thanks for any more insight Chris

Ed

Link to comment
Share on other sites

Are you sure checkout_process.php is the only problem? I have a feeling that you have other problems (ie. the "Call to undefined function: tep_get_products_master_status()" parse error you're getting).

 

Did you overwrite any of your original files with the Download Controller files? If so, you should restore your original files and start over, and then this time compare each file from the contribution with your existing file and carefully add the needed code that way. Also, the "needed code" in the contribution has comments before and after so that you tell what to copy.

 

Example:

 

// BOF: WebMakers.com Added: Downloads Controller

......

.....

// EOF: WebMakers.com Added: Downloads Controller

 

So, this means for the most part you can ignore many of the other file differences which don't involve code that is inside of these remarks.

 

If you need help with checkout_process.php, PM me and I can make those changes for you.

Link to comment
Share on other sites

Hello Chris...

 

Ah, I see. I'll revert back to my "pre download controller state". I did indeed overwrite some of the other files.

 

Making more sense now... I'll reply or PM when I get reverted back.

 

Thanks again for your continued support Chris! :)

 

Ed

Link to comment
Share on other sites

Hello Chris...

 

Ah, I see.  I'll revert back to my "pre download controller state".  I did indeed overwrite some of the other files. 

 

Making more sense now... I'll reply or PM when I get reverted back.

 

Thanks again for your continued support Chris! :)

 

Ed

 

No problem.

 

And yes, you should never overwrite your existing files with ones from a new contribution, even if you have never changed them. Even if never changed, there still could be differences.

 

So basically if the contribution install instructions don't give you details on what to search for and what to add, then you have to do a file Diff on them to see where the new code should go.

 

When you do it again, pay close attention to where the "{" signs are, etc., because if you make a mistake and put the new code above or below when it should be the opposite, the code won't work. :) Also in situations where have code from Authorize.net, etc., this will make the comparison harder and you have to think logically about where your new code (from download controller) should go in relation to the existing Authorize.net code, etc.

 

Have fun. :) If you get to a file that you just can't do (too many differences), PM me and I can do it for you. But it's a good learning experiment for you, especially if you are going to make more changes to your website.

Link to comment
Share on other sites

Hi

 

I am a total newbie and I think this contribution is what I need but I feel very daunted by what I have read in this thread. So there are a few basic things i need to understand first:

then you have to do a file Diff on them to see where the new code should go.

 

What is a file Diff?

What is a compare program and Where would I get a compare program?

 

 

Example:

 

// BOF: WebMakers.com Added: Downloads Controller

......

.....

// EOF: WebMakers.com Added: Downloads Controller

 

What does EOF and BOF stand for?

 

I know it is all about backing up - but backing up what? How? I am using c panel and have access to my php admin...is there something more in there I need to learn first?

 

TIA

Sorry to be such a newbie!

Jenny <_<

Link to comment
Share on other sites

Greetings All!

 

From my reading it appears one could use this contrib for free downloads but also allow paid items. Is this correct?

 

We are running a health shop but wish to allow e-books on the subject to be downloaded for free as they go through the checkout process.

 

Here is our site Our Health Shop

 

Top left is a category called books. We have activated the download part which works well but when you go to checkout it looks for the credit card as that is the only payment process loaded at present.

 

Your guidence appreciated.

Link to comment
Share on other sites

Hi Jenny....

 

Don't feel overwhelmed, I'm very new to this but learning quick. :)

 

A compare program is an application that you can use to look at the differences between two files. I'm currently having to deal with this having to combine two checkout_process.php files. With a compare file, I can see highlighted differences between the two.

WinMerge is the best compare app I've found and it's free. :D

 

As far as the //...BOF/EOF.... the // is for comments (which doesn't have anything to do with the code)... and I believe BOF and EOF is just "Beginning of" and "End of".

 

Backing up..... In the admin section of your site, you should have a setting for backing up your database which will save the sql file to a backup folder in catalog/admin. If you don't have that (I can't remember if that's a contrib or not), you could just go to cPANEL/phpMyAdmin and export the database file to your local machine. After that, you'll still need to backup all the files that make up your site. The way I backup is to just dump the entire site to my local machine with a ftp client (filezilla is free and would work nicely).

 

Good luck!!

Ed

Edited by NiceGuyEd
Link to comment
Share on other sites

As far as the //...BOF/EOF.... the // is for comments (which doesn't have anything to do with the code)... and I believe BOF and EOF is just "Beginning of" and "End of".

 

Jenny, I mentioned that, meaning that the new code from the contribution will usually begin with and end with those "remarks" which makes doing the file diff easier since you can concentrate just on the new code that needs to be added.

 

Most of the time for contributions you don't need to do a "file diff" because the instructions give step by step instructions on where to go in your code and what to paste into your code.

 

But since this one doesn't have those instructions, that is why you have to do a file diff. You would do the diff to compare your existing .php file against the corresponding one from the contribution. This allows you to find out where in your code you should place the contribution code.

 

Basically you just need to do it, and you'll get the hang of it. But be sure to backup your files first so if you make a mistake that you can't correct, you can just copy the originals back in and start over.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...