Jump to content
frankl

RMA Returns System for osC2.3.4BS

Recommended Posts

Admin click configuration -> RMA Returns

Change Use the RMA returns system? to true, than i think you will know what i mean.

Your value in the database table is 1. After you change this the value is 'true', than the link in the admin "customer returns" show start all the links after the install are gone.

I am working on it to fix this, but until now did not find the code for that.

Also i did find a lot table colspan issues. I will fix it too. If i finish i will send u a complett new add-on also with German languages,
because your add-on is very good to use for revocation in the EU/DE.

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

 

Share this post


Link to post
Share on other sites
1 hour ago, frankl said:

@LeeFoster

Hi Lee, can you try uploading this file to your admin directory and seeing if it works.

 

return_create.php

Nope still not working.

Also @mcmannehan is right, under admin/configuration/RMA Returns the first option 'use the rma system' is set to 1 but if you change it then it switches to true and false. 

Share this post


Link to post
Share on other sites

@mcmannehan

In admin/returns_configuration.php change

$rma_value_query = tep_db_query("select * from configuration where configuration_key = 'RMA_RETURN_SYSTEM'");
		if (!tep_db_num_rows($rma_value_query)) {
			tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ( 'Use the RMA returns system?', 'RMA_RETURN_SYSTEM', '1', 'Turn the RMA System on or off', '" . $insert_id . "', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
		}

to 

$rma_value_query = tep_db_query("select * from configuration where configuration_key = 'RMA_RETURN_SYSTEM'");
		if (!tep_db_num_rows($rma_value_query)) {
			tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ( 'Use the RMA returns system?', 'RMA_RETURN_SYSTEM', 'On', 'Turn the RMA System on or off', '" . $insert_id . "', '1','tep_cfg_select_option(array(\'On\', \'Off\'), ', now())");
		}

Then in admin/includes/boxes/returns.php change 

if (RMA_RETURN_SYSTEM == '1') {
  $cl_box_groups[] = array(
    'heading' => BOX_RETURNS_HEADING,

to

if (RMA_RETURN_SYSTEM == 'On') {
  $cl_box_groups[] = array(
    'heading' => BOX_RETURNS_HEADING,

 

Edited by LeeFoster

Share this post


Link to post
Share on other sites

@LeeFoster

you are faster ;-) !!!

but i did change like that

in admin/includes/boxes/returns.php change 

if (RMA_RETURN_SYSTEM == '1') {
  $cl_box_groups[] = array(
    'heading' => BOX_RETURNS_HEADING,

to

if (RMA_RETURN_SYSTEM == 'true') {
  $cl_box_groups[] = array(
    'heading' => BOX_RETURNS_HEADING,

 

 

In admin/returns_configuration.php change

$rma_value_query = tep_db_query("select * from configuration where configuration_key = 'RMA_RETURN_SYSTEM'");
		if (!tep_db_num_rows($rma_value_query)) {
			tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ( 'Use the RMA returns system?', 'RMA_RETURN_SYSTEM', '1', 'Turn the RMA System on or off', '" . $insert_id . "', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
		}

to

if (!tep_db_num_rows($rma_value_query)) {
			tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ( 'Use the RMA returns system?', 'RMA_RETURN_SYSTEM', 'true', 'Turn the RMA System on or off', '" . $insert_id . "', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
		}

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

 

Share this post


Link to post
Share on other sites

Thank you chaps.

@mcmannehan are you having the same problems as @LeeFoster with return_create.php in admin?


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

@frankl at this moment i can't say that, because i still check the admin area and change the function tep_image_button, to the tep_draw_button function in some files. And clear the mess with the table colspan. Also there are some problems with different languages. If i am finish with all fixes and with the translation for German languages, i will give you Information. But need a litte bit time.

BTW i did hidden from the admin the "Configuration -> RMA Returns". I think it's not nessecary to
configure that, your returns_configuration.php do all the stuff.

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

 

Share this post


Link to post
Share on other sites

@joe122joe

I'm not familiar with how that addon works but you would only need to make some modifications for when products are returned to stock (or just return items to stock manually) by the looks of it.


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

@LeeFoster

I was waiting for @mcmannehan to get back to me but he must be busy. I'll send you a PM.


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

In /admin/returns.php

Find:

<td><? echo tep_draw_input_field('refund_reference', $return->info['payment_reference']); ?></td>

Replace With:

<td><?php echo tep_draw_input_field('refund_reference', $return->info['payment_reference']); ?></td>

 

Share this post


Link to post
Share on other sites

While deleting reasons from returns_reasons.php I get the following error:

Quote

1054 - Unknown column 'returns_reason' in 'where clause'

select count(*) as count from returned_products where returns_reason = '5'

I can, however, create new reason entries wich get correctly listed afterwards. Default 4 reasons (Faulty, Damaged, Incorrect Item and Warranty) are NOT being listed either, although contained in the return_reasons table after setup.

Share this post


Link to post
Share on other sites

Thanks for the bug report @Quark.

In admin/returns_reasons.php change

    case 'delete':
      $oID = tep_db_prepare_input($_GET['oID']);
      $status_query = tep_db_query("select count(*) as count from returned_products where returns_reason = '" . tep_db_input($oID) . "'");
      $status = tep_db_fetch_array($status_query);

      $remove_status = true;
      if ($oID == DEFAULT_RETURN_REASON) {
        $remove_status = false;
        $messageStack->add(ERROR_REMOVE_DEFAULT_RETURN_REASON, 'error');
      } elseif ($status['count'] > 0) {
        $remove_status = false;
        $messageStack->add(ERROR_REASON_USED_IN_RETURNS, 'error');
      } else {
        $history_query = tep_db_query("select count(*) as count from returns_status_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_REASON_USED_IN_HISTORY, 'error');
        }
      }
      break;  

to

    case 'delete':
      $oID = tep_db_prepare_input($_GET['oID']);
      $status_query = tep_db_query("select count(*) as count from returned_products where return_reason_id = '" . tep_db_input($oID) . "'");
      $status = tep_db_fetch_array($status_query);

      $remove_status = true;
      if ($oID == DEFAULT_RETURN_REASON) {
        $remove_status = false;
        $messageStack->add(ERROR_REMOVE_DEFAULT_RETURN_REASON, 'error');
      } elseif ($status['count'] > 0) {
        $remove_status = false;
        $messageStack->add(ERROR_REASON_USED_IN_RETURNS, 'error');
      } 
      break;

 

13 hours ago, Quark said:

Default 4 reasons (Faulty, Damaged, Incorrect Item and Warranty) are NOT being listed either, although contained in the return_reasons table after setup.

I don't understand this, could you elaborate.


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

Hi @frankl. Thanks for your prompt response. Patch is working fine for me, and deleting reasons issue has been fixed.

Regarding the 4 default reasons (Faulty, Damaged, Incorrect Item and Warranty) not being listed, I have found entries in DB are being setup for language_id = 1 only. As my store uses other default language_id value I was unable to get them listed. While not a bug itself, a suggestion here would be to setup default reasons DB entries for every language_id in the system or listing entries for all languages in the system, showing blanks for those not defined.

for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
	// juicy code here...
}

 

Share this post


Link to post
Share on other sites

Sorry for my bad English.

I changed the buttons tep_image_button by tep_draw_button in admin/returns_reasons.php and admin/refund_methods.php

In admin/returns_reasons.php you can not delete a reason, it gives an error and I have solved it in another way. I was looking for an erroneous table in the database.

On line 68:

$status_query = tep_db_query("select count(*) as count from returned_products where returns_status = '" . tep_db_input($oID) . "'");

Line 79 and successive still continues and is corrected as well:

$history_query = tep_db_query("select count(*) as count from returns_status_history where returns_status_id = '" . (int)$oID . "'");

I include the modified files for verification.

I have also translated it into the Spanish language, in case someone is interested. They are not included here.

returns_reasons.php

refund_methods.php

Share this post


Link to post
Share on other sites

I am sorry for my bad english.

I have corrected another error in the admin/returns.php file.

When you have more than one return and you edit the first one, there is no problem. The problem occurs when you have to select another return from the list and click on the edit button. Log in by repeating over and over again the store header below the tabs.

To solve search (line 809)

$contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link('returns.php', tep_get_all_get_params(array('rID', 'action')) . 'rID=' . $rInfo->returns_id . '&action=edit&oID=' . $rInfo->orders_id)) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link('returns.php', tep_get_all_get_params(array('rID', 'action')) . 'rID=' . $rInfo->returns_id . '&action=delete')));

and replace with this

$contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link('returns.php', 'rID=' . $rInfo->returns_id . '&action=edit&oID=' . $rInfo->orders_id)) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link('returns.php', tep_get_all_get_params(array('rID', 'action')) . 'rID=' . $rInfo->returns_id . '&action=delete')));

Actually what we have done is eliminate tep_get_all_get_params(array('rID', 'action')) that was over and is what causes the loop.

Share this post


Link to post
Share on other sites

More errors. When creating a return from the admin there are two errors in the email that is sent to the client.
Edit catalog/admin/return_create.php
Search

$email_link = tep_href_link('returns_track.php', '', 'SSL', false);

Replace the part that says tep_href_link by tep_catalog_href_link

Not making this change causes the email to leave the access path to our admin.

 

In the same file search

$email_text .= EMAIL_TEXT_RETURNS_THANKS . EMAIL_TEXT_RETURNS_SENT . EMAIL_TEXT_RETURNS_CLOSE . EMAIL_TEXT_RETURNS_CONTACT_OPEN . EMAIL_TEXT_RETURNS_WARNING;

eliminate the part that says EMAIL_TEXT_RETURNS_CONTACT_OPEN, that definition does not exist anymore

Do exactly the same in the file catalog/return_product.php

I have not found more errors. That does not mean that there are not.

 

Share this post


Link to post
Share on other sites
7 hours ago, tmcca said:

Can this be configured for certain products not returnable? Some products on my store cant be returned.

I can see a use for this, for clearance, second hand, open box, or runout items. However, I am not doing any more coding for my addons until osC 2.3.6 is released. You would need to get this custom coded for your store. Post in the commercial section if you need this in a hurry.

Edited by frankl

Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

I just installed this.  Looking at the functions, I clicked on "Returned Products"  received the following error:
Fatal error: Call to a member function register() on a non-object in /admin/returns.php on line 17

How to correct?

Share this post


Link to post
Share on other sites

@dculley

You will need to install the hook system, which comes with the Paypal app. See 

2. Hooks for the Administration Tool and Catalog

on this page:

http://library.oscommerce.com/Package&en&paypal&oscom23&installation


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×