Add/Edit shipment address not pulling data from database

Started by concap, February 09, 2014, 21:06:31 PM

Previous topic - Next topic

concap

Joomla 2.5.17, VM 2.0.26d
I have found bug in wrong link generation, which resolves as empty Shipment Address even though we have stored data in database.

File /templates/xxx/html/com_virtuemart/cart/default_pricelist.php
Wrong Link:
<a class="details" href="<?php echo JRoute::('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&virtuemart_user_id[]=' $this->cart->user->_id$this->useXHTML$this->useSSL?>">

Correct Link:
<a class="details" href="<?php echo JRoute::('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&virtuemart_user_id[]=' $this->cart->user->_id$this->useXHTML$this->useSSL).'&virtuemart_userinfo_id='.$virtuemart_userinfo_id ?>">

To get $virtuemart_userinfo_id:
        foreach($this->cart->user->_data->userInfo as $value){
            if($value->address_type == 'ST'){
                $virtuemart_userinfo_id = $value->virtuemart_userinfo_id;
            }
        }






Pejo

I have the same problem. Shipping address is changed and saved, but in my cart won't show it. Shipping address is always empty.

Can you please tell me where to insert $virtuemart_userinfo_id:?
(I found link and replace it, but I don't know where to insert code to get $virtuemart_userinfo_id:

concap

You can put it just above href link. Your template is probably different from mine, but it should work.

        <?php

        
foreach($this->cart->user->_data->userInfo as $value){
            if(
$value->address_type == 'ST'){
                
$virtuemart_userinfo_id $value->virtuemart_userinfo_id;
            }
        }
        
?>


<a class="details" href="<?php echo JRoute::('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&virtuemart_user_id[]=' $this->cart->user->_id$this->useXHTML$this->useSSL).'&virtuemart_userinfo_id='.$virtuemart_userinfo_id ?>">
<?php echo JText::('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL'); ?>
</a>

Pejo

Thanks. But noup, doesn't work. Still showing like there is no shipping address. :(

When I press "Change delivery address" inside cart, it goes to page where I can edit my delivery address. In fields for edit there is address, everything is already there, but when I enter cart, it only shows my home address (address on the left side of the cart).

concap

Do you have there a button to show shipping address. Have a look at your source code to see if shipping address is there and is hidden just by javascript/css

Pejo

Well yeah, there is still button to add shipping address. Sorry, I am not so good in coding, where to look for code? In same .php file or somewhere in template .css files?

concap

By Source code, I meant mouse right click and View Page Source (in chrome) then you should search for your Shipping address. If you can see it there then all you need to do is modify template /templates/xxx/com_virtuemart/cart/default_pricelist.php

Pejo

OK, I have tested something and registrated as new user. So I insert normal address and then I have inserted address for delivery/shipping.

Then I have log-out and again log-in, put some items in my cart and went to cart. There was normal address show on the left side, but under shipping address (rigt side if cart) was only button again (not listed or shown saved shipping address).

when I pressed button to add shipping address, it redirect me to shipping address form, but there was my shipping address I have already enter earlier. So I just pressed save and shipping address was again shown in my cart.

Is this normal? Or should shipping address meant to be immediately show in my cart as soon as I enter?

concap

I am not VirtueMart developer either and I don't see much into VM guts. So it's hard to say if it right or not.
However totally agree that this process is bit clunky.