Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customer Account logic


Guest

Recommended Posts

We have been working on a "new" version of our site (3rd) and have been looking at the customer account logic especially when it comes to customers that are offices (ones that have entered a company name). With standard osC a company can enter their name and purchase products from your store. If they get it tax exempt then you would have to get their tax number also. Now, a customer can enter a different address without the company name and then delete the one with the company but continue to purchase from the store but with no record of the company they are associated with.

 

Now if you have SPPC installed which does store the tax number but makes it uneditable you can offer a company tax exempt status and then they can remove the company name and also their tax number by adding another address and then delete the original address with that information. If you get audited by the gov't years later then you can get hit for all the taxes owing that should have been paid for that customer.

 

Has anyone got a work around for this or advice on how to keep the info permanently and not have the customer be able to delete it. I know the easy solution is to only have one address book entry per customer but that seldom works with small companies that put purchases on their personal credit card.

 

Thanks,

 

Peter

Link to comment
Share on other sites

I have figured out what to do about it. In our site with Address Enhancer the customer can have their primary address, billing address, and shipping address and can set any address book entry as one of those choices so they can change which address is used as their primary. So if we remove the part that lets them change their primary address (leave the shipping and billing) then their primary address will be the one that they used when they signed up for an account. On that address once they enter a company name or tax id number they will not be allowed to edit them. They will just show up as text on the screen and not an editable field. Then all addresses can be edited or deleted, if we code that they can edit or delete any address except their primary address. We only allow them to edit (not delete) the primary one I think that would work. It would mean that once their company or tax id number is entered into the site it will always remain there and can be used for tax audits if one ever occurs.

Link to comment
Share on other sites

Peter,

Now if you have SPPC installed which does store the tax number but makes it uneditable you can offer a company tax exempt status and then they can remove the company name and also their tax number by adding another address and then delete the original address with that information. If you get audited by the gov't years later then you can get hit for all the taxes owing that should have been paid for that customer.

In version 4.2.0 of SPPC the tax number has moved to the table customers and is still uneditable. So the trick with the address is not working anymore.

Link to comment
Share on other sites

Attaching the tax id to the table_customer makes much more sense and does then allow the customer to change their address book but not allow them to remove/change the tax id number. Good work.

Link to comment
Share on other sites

With SPPC4.1 and Address Enhancer installed we accomplished what we wanted by making the Company Name permanent similar to the Tax ID Number.

 

Then in address_book.php we just edited a couple of parts;

 

				  <tr>
				<td class="main" align="right" valign="top"><b><?php // echo PRIMARY_ADDRESS_TITLE; ?></b></td>
				<td><?php // echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
				<td class="main" valign="top"><?php // echo tep_get_address_book_list('primary', $customer_default_address_id, $customer_id); ?></td>
				<td><?php // echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>

 

 

To take out the choice customers had to change their primary address book entry.

 

Then a bit further down the page we changed to;

 

<?php
if ($addresses['address_book_id'] == $customer_default_address_id)  {
?>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
			  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL'); ?>'">
				<td class="main"><b><?php echo tep_output_string_protected($addresses['id_name']); //rmh addr-enhancer ?></b><?php echo ' <small><i>' . $address_text . '</i></small>'; //rmh addr-enhancer?></td>
				<td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL') . '">' . tep_image_button('small_edit.gif', SMALL_IMAGE_BUTTON_EDIT) . '</a>'; ?><?php echo tep_draw_separator('pixel_trans.gif', '50', '1'); ?></td>
			  </tr>

<?php
} else {
?>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
			  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL'); ?>'">
				<td class="main"><b><?php echo tep_output_string_protected($addresses['id_name']); //rmh addr-enhancer ?></b><?php echo ' <small><i>' . $address_text . '</i></small>'; //rmh addr-enhancer?></td>
				<td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL') . '">' . tep_image_button('small_edit.gif', SMALL_IMAGE_BUTTON_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $addresses['address_book_id'], 'SSL') . '">' . tep_image_button('small_delete.gif', SMALL_IMAGE_BUTTON_DELETE) . '</a>'; ?></td>
			  </tr>
<?php
}
?>

 

This just checks for the primary address and then only displays the "edit" button for that entry but still allows the "edit" and "delete" button for the other entries in the address book.

 

When a customer signs up for an account and has filled in the Company and Tax fields they can be approved for the "wholesale" customer pricing and taxes. But now the info they entered can not be changed or deleted by them making it always available for tax records.

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