Project:Ubercart / Location Integration
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I can't seem to get it to do anything.

I have tested it by creating an order but no address are found.

I also tried creating an order first and seeing if the location showed up in the user.

Neither worked.

I could really use this if someone can get it to work.

Comments

#1

No. This does not work. It would be great if it did. But if you are in the checkout and you choose a Saved Location it does not get imported to Paypal you can not actually view the address when you Preview the order and you cannot send it in an email. I really need this function. I hope someone else has the need and would like to fix it.

#2

@gweston: i have gotten it to work, yes. im using the 2nd listed dev version on the site (notice they both are of the same version but one is a different file size / posted more recently). the current logged in user that is checking out has their user location filled on their account / profile, and during checkout it shows a drop down that lets you choose that location and it fills it in.

@nasheet: your issue sounds unrelated to simply getting this module to work, which it appears you have done in a basic sense. your issue is likely worth creating a separate issue about, specifically related to paypal as this module does work in a basic sense (minus paypal and other things i havent tested yet) but the review page, the email, the order history, everything shows the correct address. so its likely just something specific about the paypal integration.

#3

It seems to work in one way only.

I've made a test with a fictive user:

If the location informations are collected for a user, they will partially fill the Ubercart address information.
But if the ubercart addresses informations are collected on registration (with the UC_address module), they won't fill the informations of the location module.
If I go on the user page to see his address, the Location module fields are blank. I can only access the UC address informations.
It's too bad :(

Does it work for anybody in this way ?

Thank you.

#4

I guess I found out why it's not working for me...
The locations are saved to user account if a customer completes checkout...

What can I do to save the locations if a customer register on the website via uc_address ?

Thank you for your help :)

#5

Not saying I got this to work, as I haven't yet.
But this module is the integration between Locations and Ubercart, not the Addresses module, per previous post.

So far Upon site regsistration it saves the address, and in the Ubercart checkout it gives me a dropdown for the saved address, however when I choose that address it does not fill in the information in the respective fields. If I make the fields that it doesn't complete invisible, in hope that the information would carry over anyway it doesn't add any information the the remainder of the checkout process. SO I am guessing the big hurdle at the moment is to get the fields to autocomplete when you have chosen the saved address, once it can do this then it will work correctly.

I will look into how to do this, and If I find a solution I will post it. Obviously if anyone else has a fix then please post.

#6

Are there any javascript errors when you select a location from the location module and it doesn't fill in the location fields on checkout?

#7

No there are no errors. I select a an address via the dropdown and nothing happens.

#8

I can't work out how to fix this myself, as I am not really a programmer. This is the only thing that does not seem to work, once this is fixed then it is good to go.
Does anyone have a solution for this?

#9

Would need some details about the issue. While this is not a solution to your issue, it may be a viable temporary replacement for a single default location. Should go in a custom module.

<?php

 
/**
   * Implementation of hook_form_alter().
   */
 
function mymodule_form_alter(&$form, $form_state, $form_id) {
    switch (
$form_id) {
      case
'uc_cart_checkout_form':
        global
$user;
       
$profile = user_load($user->uid);
       
//print_r($profile);

       
$form['panes']['delivery']['delivery_street1']['#default_value'] = $profile->location['street'];
       
$form['panes']['delivery']['delivery_street2']['#default_value'] = $profile->location['additional'];
       
$form['panes']['delivery']['delivery_city']['#default_value'] = $profile->location['city'];
       
$form['panes']['delivery']['delivery_postal_code']['#default_value'] = $profile->location['postal_code'];
        if (
$form['panes']['delivery']['delivery_zone']['#options']) {
          foreach (
$form['panes']['delivery']['delivery_zone']['#options'] as $provinces => $province) {
            if (
$province == $profile->location['province_name']) {
             
$form['panes']['delivery']['delivery_zone']['#default_value'] = $provinces;
            }
          }             
        }

        break;
    }
  }
?>

#10

Very nice.
That worked a treat. I only use one address anyway, thankyou.

Just to expand on what the problem was though. On the checkout when you choose an address via the dropdwon of saved addresses, the fields would not autocomplete with the details of this saved address.

#11

Woops. Thought this worked but didn't.
It doesn't seem to grab the information from the locations field in my profile.
I made a custom module using:

location_uc_fix.info

; $Id$
name = Location_uc_fix
description = This is a fix for the location_uc checkout
core = 6.x

package = "Test"

version = "6.x-0.1-dev"

and

location_uc_fix.module

<?php

 
/**
   * Implementation of hook_form_alter().
   */
 
function mymodule_form_alter(&$form, $form_state, $form_id) {
    switch (
$form_id) {
      case
'uc_cart_checkout_form':
        global
$user;
       
$profile = user_load($user->uid);
       
//print_r($profile);
       
$form['panes']['delivery']['delivery_street1']['#default_value'] = $profile->location['street'];
       
$form['panes']['delivery']['delivery_street2']['#default_value'] = $profile->location['additional'];
       
$form['panes']['delivery']['delivery_city']['#default_value'] = $profile->location['city'];
       
$form['panes']['delivery']['delivery_postal_code']['#default_value'] = $profile->location['postal_code'];
        if (
$form['panes']['delivery']['delivery_zone']['#options']) {
          foreach (
$form['panes']['delivery']['delivery_zone']['#options'] as $provinces => $province) {
            if (
$province == $profile->location['province_name']) {
             
$form['panes']['delivery']['delivery_zone']['#default_value'] = $provinces;
            }
          }            
        }

        break;
    }
  }
?>

knowing me though, I have probably done this module wrong.

#12

Change the name of the function from mymodule_form_alter to location_uc_fix_form_alter and it should be good to go.

#13

That did the trick. Thankyou very much.

nobody click here