Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

RMA Returns System for osC2.3.4BS


frankl

Recommended Posts

https://apps.oscommerce.com/m2hDP&rma-returns-system-for-osc2-3-4bs

 

Full product returns system for osCommerce.

Features

  • ·         No core file changes needed, just upload to your store.
  • ·         One click install.
  • ·         Works with PHP 7.1 and Edge
  • ·         Create returns from admin, or allow customers to create their own, or both.
  • ·         You choose which order statuses orders must be at for customers to return items.
  • ·         You choose how many days after ordering customers can return items from an order.
  • ·         Includes issuing of discount coupons direct from the returns admin page*.
  • ·         Includes Paypal refunds direct from the returns admin page**. Partial refunds OK.
  • ·         If you require serial numbers to be entered this can be turned on in admin. You can also make serial numbers optional or compulsory.
  • ·         Return items to inventory if you desire, just tick a box on the returns admin page.
  • ·         Set a default restocking fee, and inform the customer when they fill in the return request.
  • ·         Terms and conditions can be shown to customers before they fill in a return request, if so they must agree to continue. They can also have the terms and conditions emailed to their email address.
  • ·         One click comments when updating orders.
  • ·         Unlimited number of return reasons.
  • ·         Unlimited number of refund methods.
  • ·         Only logged in customers can create a return request.
  • ·         Search for RMAs in admin by RMA Number, customer name, or order id
  • ·         Will not create duplicate RMA request numbers.

RMA-sshot-03.png

Edited by frankl

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

Error for refund_methods.php

Fatal error: Uncaught Error: Call to undefined function tep_get_refund_method_name() in ...\refund_methods.php:205 Stack trace: #0 {main} thrown in ...\refund_methods.php on line 205

$orders_status['return_reason_id'], 'text' => $orders_status['return_reason_name'] ); } return $orders_status_array; } function tep_get_return_reason_name($return_reason_id, $language_id = '') { global $languages_id; if ($return_reason_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select return_reason_name from return_reasons where return_reason_id = '" . $return_reason_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['return_reason_name']; } function tep_calculate_deduct($price, $tax) { global $currencies; return (($price / 100) * $tax); } function tep_get_returns_status() { global $languages_id; $orders_status_array = array(); $orders_status_query = tep_db_query("select returns_status_id, returns_status_name from returns_status where language_id = '" . $languages_id . "' order by returns_status_id"); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_status_array[] = array('id' => $orders_status['returns_status_id'], 'text' => $orders_status['returns_status_name'] ); } return $orders_status_array; } function tep_get_returns_status_name($returns_status_id, $language_id = '') { global $languages_id; if ($returns_status_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select returns_status_name from returns_status where returns_status_id = '" . $returns_status_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['returns_status_name']; } function tep_get_refund_method() { global $languages_id; $orders_status_array = array(); $orders_status_query = tep_db_query("select refund_method_id, refund_method_name from refund_method where language_id = '" . $languages_id . "' order by refund_method_id"); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_status_array[] = array('id' => $orders_status['refund_method_id'], 'text' => $orders_status['refund_method_name'] ); } return $orders_status_array; } function tep_get_refund_method_name($refund_method_id, $language_id = '') { global $languages_id; if ($refund_method_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select refund_method_name from refund_method where refund_method_id = '" . $refund_method_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['refund_method_name']; } function tep_remove_return($order_id, $restock = false) { if ($restock == 'on') { $order_query = tep_db_query("select products_id, products_quantity from returns_products_data where returns_id = '" . tep_db_input($order_id) . "'"); while ($order = tep_db_fetch_array($order_query)) { tep_db_query("update products set products_quantity = products_quantity + " . $order['products_quantity'] . " where products_id = '" . $order['products_id'] . "'"); tep_db_query("update products set products_status = 1 where products_quantity > 0 and products_id = '" . $order['products_id'] . "'"); } } tep_db_query("delete from returned_products where returns_id = '" . tep_db_input($order_id) . "'"); tep_db_query("delete from returns_products_data where returns_id = '" . tep_db_input($order_id) . "'"); tep_db_query("delete from refund_payments where returns_id = '" . tep_db_input($order_id) . "'"); }

 

Error for returns_reasons.php:

Fatal error: Uncaught Error: Call to undefined function tep_get_return_reason_name() in ...\returns_reasons.php:204 Stack trace: #0 {main} thrown in ...\returns_reasons.php on line 204

$orders_status['return_reason_id'], 'text' => $orders_status['return_reason_name'] ); } return $orders_status_array; } function tep_get_return_reason_name($return_reason_id, $language_id = '') { global $languages_id; if ($return_reason_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select return_reason_name from return_reasons where return_reason_id = '" . $return_reason_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['return_reason_name']; } function tep_calculate_deduct($price, $tax) { global $currencies; return (($price / 100) * $tax); } function tep_get_returns_status() { global $languages_id; $orders_status_array = array(); $orders_status_query = tep_db_query("select returns_status_id, returns_status_name from returns_status where language_id = '" . $languages_id . "' order by returns_status_id"); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_status_array[] = array('id' => $orders_status['returns_status_id'], 'text' => $orders_status['returns_status_name'] ); } return $orders_status_array; } function tep_get_returns_status_name($returns_status_id, $language_id = '') { global $languages_id; if ($returns_status_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select returns_status_name from returns_status where returns_status_id = '" . $returns_status_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['returns_status_name']; } function tep_get_refund_method() { global $languages_id; $orders_status_array = array(); $orders_status_query = tep_db_query("select refund_method_id, refund_method_name from refund_method where language_id = '" . $languages_id . "' order by refund_method_id"); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_status_array[] = array('id' => $orders_status['refund_method_id'], 'text' => $orders_status['refund_method_name'] ); } return $orders_status_array; } function tep_get_refund_method_name($refund_method_id, $language_id = '') { global $languages_id; if ($refund_method_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select refund_method_name from refund_method where refund_method_id = '" . $refund_method_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['refund_method_name']; } function tep_remove_return($order_id, $restock = false) { if ($restock == 'on') { $order_query = tep_db_query("select products_id, products_quantity from returns_products_data where returns_id = '" . tep_db_input($order_id) . "'"); while ($order = tep_db_fetch_array($order_query)) { tep_db_query("update products set products_quantity = products_quantity + " . $order['products_quantity'] . " where products_id = '" . $order['products_id'] . "'"); tep_db_query("update products set products_status = 1 where products_quantity > 0 and products_id = '" . $order['products_id'] . "'"); } } tep_db_query("delete from returned_products where returns_id = '" . tep_db_input($order_id) . "'"); tep_db_query("delete from returns_products_data where returns_id = '" . tep_db_input($order_id) . "'"); tep_db_query("delete from refund_payments where returns_id = '" . tep_db_input($order_id) . "'"); }

 

Error for returns_reasons.php: Fatal error: Uncaught Error: Call to undefined function tep_get_returns_status_name() in ...\returns_status.php:220 Stack trace: #0 {main} thrown in ...\returns_status.php on line 220

orders_status['return_reason_id'], 'text' => $orders_status['return_reason_name'] ); } return $orders_status_array; } function tep_get_return_reason_name($return_reason_id, $language_id = '') { global $languages_id; if ($return_reason_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select return_reason_name from return_reasons where return_reason_id = '" . $return_reason_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['return_reason_name']; } function tep_calculate_deduct($price, $tax) { global $currencies; return (($price / 100) * $tax); } function tep_get_returns_status() { global $languages_id; $orders_status_array = array(); $orders_status_query = tep_db_query("select returns_status_id, returns_status_name from returns_status where language_id = '" . $languages_id . "' order by returns_status_id"); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_status_array[] = array('id' => $orders_status['returns_status_id'], 'text' => $orders_status['returns_status_name'] ); } return $orders_status_array; } function tep_get_returns_status_name($returns_status_id, $language_id = '') { global $languages_id; if ($returns_status_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select returns_status_name from returns_status where returns_status_id = '" . $returns_status_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['returns_status_name']; } function tep_get_refund_method() { global $languages_id; $orders_status_array = array(); $orders_status_query = tep_db_query("select refund_method_id, refund_method_name from refund_method where language_id = '" . $languages_id . "' order by refund_method_id"); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_status_array[] = array('id' => $orders_status['refund_method_id'], 'text' => $orders_status['refund_method_name'] ); } return $orders_status_array; } function tep_get_refund_method_name($refund_method_id, $language_id = '') { global $languages_id; if ($refund_method_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select refund_method_name from refund_method where refund_method_id = '" . $refund_method_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['refund_method_name']; } function tep_remove_return($order_id, $restock = false) { if ($restock == 'on') { $order_query = tep_db_query("select products_id, products_quantity from returns_products_data where returns_id = '" . tep_db_input($order_id) . "'"); while ($order = tep_db_fetch_array($order_query)) { tep_db_query("update products set products_quantity = products_quantity + " . $order['products_quantity'] . " where products_id = '" . $order['products_id'] . "'"); tep_db_query("update products set products_status = 1 where products_quantity > 0 and products_id = '" . $order['products_id'] . "'"); } } tep_db_query("delete from returned_products where returns_id = '" . tep_db_input($order_id) . "'"); tep_db_query("delete from returns_products_data where returns_id = '" . tep_db_input($order_id) . "'"); tep_db_query("delete from refund_payments where returns_id = '" . tep_db_input($order_id) . "'"); }

Link to comment
Share on other sites

Just now, frankl said:

@rubberfashion

Did you upload all the files correctly? Those functions are in admin/includes/functions/return_functions.php

Is that file present?

I'm having the same issue and I've uploaded the file 3 times. It seems to be falling over with the building of the array for tep_get_return_reason

Link to comment
Share on other sites

7 minutes ago, rubberfashion said:

If i comment out the function file

//include('includes/functions/return_functions.php');

i get the same error. So maybe the file is not included.

But the data dump at the top isn't there now

Commenting out the file and adding the function in to return_reasons.php fixes the issue.

Edited by LeeFoster
Link to comment
Share on other sites

When i put the content of the includes/functions/return_functions.php in General.php ... it works.

But i also get this Text above the header:

$orders_status['return_reason_id'], 'text' => $orders_status['return_reason_name'] ); } return $orders_status_array; } function tep_get_return_reason_name($return_reason_id, $language_id = '') { global $languages_id; if ($return_reason_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select return_reason_name from return_reasons where return_reason_id = '" . $return_reason_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['return_reason_name']; } function tep_calculate_deduct($price, $tax) { global $currencies; return (($price / 100) * $tax); } function tep_get_returns_status() { global $languages_id; $orders_status_array = array(); $orders_status_query = tep_db_query("select returns_status_id, returns_status_name from returns_status where language_id = '" . $languages_id . "' order by returns_status_id"); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_status_array[] = array('id' => $orders_status['returns_status_id'], 'text' => $orders_status['returns_status_name'] ); } return $orders_status_array; } function tep_get_returns_status_name($returns_status_id, $language_id = '') { global $languages_id; if ($returns_status_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select returns_status_name from returns_status where returns_status_id = '" . $returns_status_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['returns_status_name']; } function tep_get_refund_method() { global $languages_id; $orders_status_array = array(); $orders_status_query = tep_db_query("select refund_method_id, refund_method_name from refund_method where language_id = '" . $languages_id . "' order by refund_method_id"); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_status_array[] = array('id' => $orders_status['refund_method_id'], 'text' => $orders_status['refund_method_name'] ); } return $orders_status_array; } function tep_get_refund_method_name($refund_method_id, $language_id = '') { global $languages_id; if ($refund_method_id < 1) return TEXT_DEFAULT; if (!is_numeric($language_id)) $language_id = $languages_id; $status_query = tep_db_query("select refund_method_name from refund_method where refund_method_id = '" . $refund_method_id . "' and language_id = '" . $language_id . "'"); $status = tep_db_fetch_array($status_query); return $status['refund_method_name']; } function tep_remove_return($order_id, $restock = false) { if ($restock == 'on') { $order_query = tep_db_query("select products_id, products_quantity from returns_products_data where returns_id = '" . tep_db_input($order_id) . "'"); while ($order = tep_db_fetch_array($order_query)) { tep_db_query("update products set products_quantity = products_quantity + " . $order['products_quantity'] . " where products_id = '" . $order['products_id'] . "'"); tep_db_query("update products set products_status = 1 where products_quantity > 0 and products_id = '" . $order['products_id'] . "'"); } } tep_db_query("delete from returned_products where returns_id = '" . tep_db_input($order_id) . "'"); tep_db_query("delete from returns_products_data where returns_id = '" . tep_db_input($order_id) . "'"); tep_db_query("delete from refund_payments where returns_id = '" . tep_db_input($order_id) . "'"); }

 

When you comment out //include('includes/functions/return_functions.php');  in each file and put the functions in general.php the text in the header is not there.

Edited by rubberfashion
Link to comment
Share on other sites

Next issue: When i try to return a product .... i get same page again. Continue reload only the page. I see only page with radio button again.

This happen in front page, also in admin page.

return_product.php?action=return_new&orders_id=....

Edited by rubberfashion
Link to comment
Share on other sites

@rubberfashion @LeeFoster

 

Thank you for the bug reports. Can you explain exactly what you mean? Exactly what you are trying to do? I can upload bug fixes today once I know what is happening.

 

On 26/08/2017 at 8:05 PM, LeeFoster said:

The continue button on both pages just appear to change the URL but then nothing is done with it.

 

On 26/08/2017 at 7:42 PM, rubberfashion said:

Next issue: When i try to return a product .... i get same page again. Continue reload only the page. I see only page with radio button again.

This happen in front page, also in admin page.

return_product.php?action=return_new&orders_id=....

 

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

@rubberfashion @LeeFoster

I have searched through the files and found a few legacy <? tags. This should fix any problems you will be having. App update has been uploaded.

RMA Returns System v1.1

Bug fixes

  • Changed stray <? Tags to <?php
  • Fixed ‘Request a Return’ button on order history info page to allow multiple returns if there was more than one of the single product ordered.

Full package, just upload to replace all files.

 

https://apps.oscommerce.com/m2hDP&rma-returns-system-for-osc2-3-4bs

Edited by frankl

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

@frankl

Thats a very good work u did. Works well after the fix. Thank you!!!

  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Link to comment
Share on other sites

But i did find one thing. In the admin you still use the function tep_image_button, that should be the tep_draw_button function.

in the file: returns_reasons.php and refund_methods.php

Edited by mcmannehan
  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Link to comment
Share on other sites

and in refund_methods.php you did comment out the break, delete is working, but the case is not closed.

case 'delete':
      $oID = tep_db_prepare_input($_GET['oID']);
       /*
      $status_query = tep_db_query("select count(*) as count from refund_method where orders_status = '" . tep_db_input($oID) . "'");
      $status = tep_db_fetch_array($status_query);
       */
      $remove_status = true;
    /*  if ($oID == DEFAULT_ORDERS_STATUS_ID) {
        $remove_status = false;
        $messageStack->add(ERROR_REMOVE_DEFAULT_ORDER_STATUS, 'error');
      } elseif ($status['count'] > 0) {
        $remove_status = false;
        $messageStack->add(ERROR_STATUS_USED_IN_ORDERS, 'error');
      } else {
        $history_query = tep_db_query("select count(*) as count from " . TABLE_REFUND_METHOD_HISTORY . " where '" . tep_db_input($oID) . "' in (new_value, old_value)");
        $history = tep_db_fetch_array($history_query);
        if ($history['count'] > 0) {
          $remove_status = false;
          $messageStack->add(ERROR_STATUS_USED_IN_HISTORY, 'error');
        }
      }
      break;  */

 

  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Link to comment
Share on other sites

6 hours ago, frankl said:

@rubberfashion @LeeFoster

I have searched through the files and found a few legacy <? tags. This should fix any problems you will be having. App update has been uploaded.

RMA Returns System v1.1

Bug fixes

  • Changed stray <? Tags to <?php
  • Fixed ‘Request a Return’ button on order history info page to allow multiple returns if there was more than one of the single product ordered.

Full package, just upload to replace all files.

 

https://apps.oscommerce.com/m2hDP&rma-returns-system-for-osc2-3-4bs

This fixed the issue on the customer side of the return creation but the admin side still isn't.

When you go to orders and create the return you select the item you want to return and click continue and it does nothing.

Hope that helps.

Link to comment
Share on other sites

And now, i did check a bug in the configuration table. if you change Use the RMA returns system? to true, than the installing is gone. Your value before change this, is 1.

Edited by mcmannehan
  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Link to comment
Share on other sites

Info: date values in the create datebase should not be like 0000-00-00 00:00:00. In MySQL 5.7 with strict SQL Mode an error will occurse.

I recommand change the value to 1970-01-01 00:00:00

  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

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...