Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2006
    Posts
    19
    Plugin Contributions
    0

    help question Custom one-time shipping address - is it possible?

    Is there anything out there that would allow us to give our customers the option to enter a one-time, per-order shipping address, without saving that address to their account?

    Here's why: We operate a wholesale site, and we drop-ship to our customers' customers. So, the seller buys from us, enters their customer's shipping address, and we ship it directly to their customer. Most of the time, they only sell to the same customer once, thereby effectively eliminating the need to store many addresses in the system.

    As a temporary patch, we increased the saved address maximum to 50 or so, but we eventually will need to get this problem dealt with so we don't have a database of 20,000 saved, unused shipping addresses...

    Any help is appreciated. Thanks!
    jbhansen

  2. #2
    Join Date
    Jan 2011
    Posts
    1
    Plugin Contributions
    0

    Default Re: Custom one-time shipping address - is it possible?

    Hello,



    /************* PROBLEM **********************/

    I bumped into this post recently because I was in need of something similar to what you are looking. Let me tell you what was my problem.

    I am working on a site that is only able to deliver to a list of zipcodes. I had already managed to restrict the zipcodes that can be entered whenever an account is created or whenever a user wants to add a new addres to their address book.

    However I did not want this restriction on the billing address step since I want customers to be able to pay with cards that are registered under any zip code. I managed to make this restriction not to apply whenever the user wanted to change the billing address since this one is used in order to accept card payments.

    The problem was that when a user enters their billing address it automatically saves itself into the users address book. This was a conflict for me because I did not want users to have an address in their address book with a zip code or address overall that was outside that list I mentioned before.


    I found two solutions for my problem but one of them could not be implemented due to my hosting service. However the second solution is fit to be implemented on any server.


    /********** SOLUTION*******************/
    In case you don't want to read all that.

    1: Create a trigger on the database after an insert on orders table.

    2: Execute statement in a php statement.


    In my case I opted for the second solution since my hosting service did not allowed the creation of triggers in their databases for several reasons.

    The file which I decided to modify is uner the following folder structure:

    zen_cart_root_folder/includes/templates/template_default/templates/tpl_checkout_success_default.php

    I went all the way down on the source file and added the following lines.

    <?php

    $db->Execute("DELETE FROM orders WHERE entry_postcode NOT IN (SELECT postcode FROM my_postcode_table_I_added_to_db)");

    ?>


    There is one flaw with this solution though. There is a possibility that after the user adds the new address that has no restriction he may go back and change the delivery address to the one which is momentarily saved in his address book. I oversaw this flaw since it is not very likely that a user would go back at such moment and reset the delivery address one more time. Besides this whenever any user gets an order placed this statement is ran and all the unwanted addresses in every user account is cleaned away.

    The good thing is that the billing address is saved in the orders table so this solution does not corrupt the zencart admin site invoice and orders functionality.


    There are many other grounds on which such addresses can be deleted so this deletion solution can be applied in other grounds.



    This was the closest post I came across when first trying to look for a solution but nothing was available.

    Hope it helps.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 1 Apr 2016, 02:10 PM
  2. allow 2 shipping modules at one time
    By cpoet in forum Addon Shipping Modules
    Replies: 0
    Last Post: 17 Aug 2010, 12:40 PM
  3. One time shipping fee issue
    By deeg in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 30 Apr 2010, 10:33 AM
  4. Is it possible to make custom shipping methods?
    By soskuthy in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 18 Mar 2009, 10:44 PM
  5. change shipping address of order in admin? Possible?
    By airtime in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 19 Jul 2007, 06:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg