Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    524
    Plugin Contributions
    0

    help question Changing the Structure for my Webservice

    I have a similar issue to another Zenner on UPS Shipping Module. The product tables and the address book tables are missing some highly needed fields to properly make the UPS Webservice work as it supposed to.

    However, I am very hesitant to change the MySQL dBase without asking the following question. If I add a new field and its supporting loading functions...are there any other issues I need to consider (as am I corrupting something else that is not obvious?). I have done this before with other dbs but this is a real healthy animal you have here I do not want to make it sick.

    Items needed.

    • products table...Length, Width and Height of cube surrounding product
    • Volume Adjustment Factor....up or down adjustment of the calculated volume for non-rectangular items (will be an advanced change based on experience)
    • Products table....small enum noting whether this can be considered a "large" package by UPS and USPS
    • Address Book Table...small enum noting whether this address is Residential or Commercial (shippers now have a $2.50 residential delivery fee )

  2. #2
    Join Date
    Jan 2007
    Posts
    1,484
    Plugin Contributions
    10

    Default Re: Changing the Zencart Database Structure

    There are no issues with doing what you want. There is a mod called auction site attributes that add the dimensional factors into the product table with the fields added on the product creation page. I have added a ton of extra fields to the product table for various functions. Please share what you are working on so others may find benefit, this is particularly interesting for me for sure and I'd love to see what you are doing.

    Zen Cart and it's community are the best!!

  3. #3
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    524
    Plugin Contributions
    0

    Default Re: Changing the Database Structure

    The the first part is to add a field for the address book which i have done. It is currently setup as an enumerated field with the name xxx and the possible values of RES, COM and OTH. This may change but i think it should work.

    Right now I am going over customers.php from the admin folders to verify how it works. This is one area that will need the code modified to handle a new variable.

    Based on this field, I can then do some heavy modification on the UPS shipping module...plans are to make it work via SOAP. first off, I want to use UPS's webservice to validate that an address is what the customer says it is....if not, then build in an errror handler.

    If so, then we can then get the proper shipping quotes based on the address type.


    Now i am not sure if this is the place to ask questions but I do see some things in the php code that I have NEVER seen before I have found a few documented in the Wiki but some still make me go . Where is the proper place in the forum to ask specific questions like that?

  4. #4
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    524
    Plugin Contributions
    0

    Default Re: Changing the Database Structure

    oops....XXXX above was supposed to be

    entry_address_type

  5. #5
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    524
    Plugin Contributions
    0

    help question Re: Changing the Database Structure

    okay...my first hick-up....

    I am modifying customers.php. I have created the linked radio buttons to the correct field and they work. I created a define for ENTRY_ADDRESS_TYPE in english.php and set it to 'Address Type:'

    but...the <?php echo ENTRY_ADDRESS_TYPE ?> does not work.

    I get ENTRY_ADDRESS_TYPE instead of 'Address Type:'

    Do all the defines get loaded at one time maybe? If so, when is the trigger?

    thanks...just working all this through my head.

  6. #6
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    524
    Plugin Contributions
    0

    Default Re: Changing the Database Structure



    next time I need to remember that there is more than one filename called english.php. I modified the on in /zencart/includes and NOT the one in /zencart/adminXXXXX/includes. Geez.

    I have a new variable in the address book that can be viewed and edited from within the backoffice "customers" page. It also updates the database properly now as well.

    Next step..repeat the above for the products tables.....here goes nothing!

  7. #7
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    524
    Plugin Contributions
    0

    Default Re: Changing the Database Structure

    Well, I have MySQL Structure modified. I have the Admin pages modified to display and save the additional variables. I am working on some code to try and get the dimensional weight portion of UPS done.

  8. #8
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    524
    Plugin Contributions
    0

    Default Re: Changing the Database Structure

    Well, I have worked on this project and made some very good progress...HOWEVER...I AM NOW STUMPED.

    1. New Fields are in the Database.
    2. Admin pages have been modified for the new fields.
    3. A new XML version of UPS's shipping service is fully functional in isolation....but I have not been able to integrate it successfully into Zen-Cart yet.

    The UPS class I create will handle multiple packages of different sizes and weights and even handle both residential and commercial addresses based on an address type. The new class works to display the UPS shipping options on the checkout shipping page. It is even returning UPS's "negotiated rates" and can be expanded to complete this.

    The problem so far lies somewhere between the shipping checkout page and the payment page. If I add a simple "echo" statement to ups.php in the function "quote()", the server hangs. I cannot even add an include statement in this code right now without it hanging. It's not a syntax issue...looks more like variable being empty an the code not error trapping it.

    Still looking for the needle in the haystack.

  9. #9
    Join Date
    Jan 2007
    Posts
    1,484
    Plugin Contributions
    10

    Default Re: Changing the Database Structure

    EDIT: saw your other thread
    Last edited by lankeeyankee; 3 May 2011 at 03:41 PM.

    Zen Cart and it's community are the best!!

  10. #10
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    524
    Plugin Contributions
    0

    Default Re: Changing the Database Structure

    Quote Originally Posted by lankeeyankee View Post
    EDIT: saw your other thread
    yes...all I can say is "What an idiot" in the tone and sound of Hermione Grainger in Harry Potter!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 FedEx Webservice 1.4.9 returning List price
    By split63 in forum Addon Shipping Modules
    Replies: 1
    Last Post: 27 Sep 2015, 12:58 AM
  2. Changing structure/style of index listing...
    By gavinboha in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 May 2008, 12:32 AM
  3. Changing file structure
    By A-1 Electronics in forum Basic Configuration
    Replies: 6
    Last Post: 1 May 2007, 05:20 PM
  4. Changing the structure?
    By squeakypants in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 30 Oct 2006, 08:20 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR