php - Magento: can't retrieve saved billing address -
i have problem trying show saved billing address in checkout process. basically, existing code (onepagecheckout) uses following code show dropdown list existing addresses:
<?php echo $this->getaddresseshtmlselect('billing') ?> // billing <?php echo $this->getaddresseshtmlselect('shipping') ?> // shipping
the problem billing dropdown has same values shipping one.
the code shows dropdown following:
<?php echo $this->getaddresseshtmlselect('billing') ?> // billing <?php echo $this->getaddresseshtmlselect('shipping') ?> // shipping
shipping correct, billing shows shipping values.
but if perform following query on db:
select * sales_flat_quote_address customer_id = <my_customer_id>;
i can see 2 addresses, 1 address_type
shipping, 1 address_type
billing.
the method reported here has same problem.
i'm stucked...any hints appreciated. thanks.
edit:
mysql select:
select address_id, same_as_billing, address_type sales_flat_quote_address customer_id = 9419; +------------+-----------------+--------------+ | address_id | same_as_billing | address_type | +------------+-----------------+--------------+ | 28338 | 0 | shipping | | 28353 | 0 | billing | | 28354 | 0 | shipping | +------------+-----------------+--------------+
magento saves customer's address(shipping , billing only) in sales_flat_quote_address
sales-quote attribute not customer attribute. can keep 2 different address. , of course can see 2 different address billing , shipping. there field in table called same_as_billing
. check out. filed contains 0
or 1
. magento display same address shipping , billing if contains 1
or else display 2 different address (actually there option during check out same shipping address). think have solved problem.
update:
it not necessary customer should have default address.
Comments
Post a Comment