Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

RMA Returns System for osC2.3.4BS


frankl

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

 

Link to comment
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. 

Link to comment
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
Link to comment
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...

 

Link to comment
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...

 

Link to comment
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>

 

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
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.

osCommerce user since 2003! :thumbsup:

Link to comment
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...
}

 

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
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.

Link to comment
Share on other sites

  • 5 weeks later...

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.

 

Link to comment
Share on other sites

  • 1 month later...
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

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

  • 1 month later...

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?

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