Author Topic: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)  (Read 4865 times)

serapol

  • Beginner
  • *
  • Posts: 43
I noticed that B new version you can remove additional shipping address, but this option does not work.

The solution found in the file components/com_virtuemart/controllers/user.php on line 259
The name of the function does not correspond to the transferred task

Transmitted
Code: [Select]
task=deleteAddressST

The name of the function
Code: [Select]
function removeAddressST ()

The solution is simple to rename the function in
Code: [Select]
function deleteAddressST ()

By the way the query in the controller violates the specific MVC model, still need to remove the function itself to move into the model.

Plus it would be logical to add in the $msg language line so that you can use the translation

efocus

  • Jr. Member
  • **
  • Posts: 57
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #1 on: July 21, 2012, 05:52:46 am »
Maybe I missed something but I tried this fix and I still can't delete a user. Trying to do so just takes me to a blank content page. I tried clearing the cache but that didn't help either.

serapol

  • Beginner
  • *
  • Posts: 43
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #2 on: July 23, 2012, 16:30:09 pm »
Maybe I missed something but I tried this fix and I still can't delete a user. Trying to do so just takes me to a blank content page. I tried clearing the cache but that didn't help either.

specifically what you do not succeed, there is only need to rename the function

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9913
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #3 on: July 23, 2012, 17:14:02 pm »
no other way round, change the link in shopfunctions.php line 626 to &task=removeAddressST
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ivus

  • Full Member
  • ***
  • Posts: 534
  • - YAY me... proud member of the 500 club...
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #4 on: July 24, 2012, 03:13:55 am »
Hmmmmm.

I have the latest version of both VM and J! and I'm just wondering if this "function removeAddressST ()" is a front end or a back end function?

I can see it in the front but I can't find it in the back? So changing the link still does nothing?


ivus

  • Full Member
  • ***
  • Posts: 534
  • - YAY me... proud member of the 500 club...
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #5 on: July 24, 2012, 03:30:17 am »
OK, so I fixed it myself. In case anyone needs to, here's what to do:



/administrator/components/com_virtuemart/helpers/shopfunction.php
line 626

Original
Code: [Select]

$_shipTo[] = '&nbsp;&nbsp;<a href="index.php?option=com_virtuemart&view=user&task=deleteAddressST&virtuemart_user_id[]=' . $_addressList[$_i]->virtuemart_user_id . '&virtuemart_userinfo_id=' . $_addressList[$_i]->virtuemart_userinfo_id . '" class="icon_delete">'.JText::_('COM_VIRTUEMART_USER_DELETE_ST').'</a></li>';


Change to
Code: [Select]

$_shipTo[] = '&nbsp;&nbsp;<a href="index.php?option=com_virtuemart&view=user&task=removeAddressST&virtuemart_user_id=' . $_addressList[$_i]->virtuemart_user_id . '&virtuemart_userinfo_id=' . $_addressList[$_i]->virtuemart_userinfo_id . '" class="icon_delete">'.JText::_('COM_VIRTUEMART_USER_DELETE_ST').'</a></li>';





/administrator/components/com_virtuemart/controller/user.php

Add
Code: [Select]

function removeAddressST(){

$db = JFactory::getDBO();

$virtuemart_user_id = JRequest::getVar('virtuemart_user_id');
$virtuemart_userinfo_id = JRequest::getVar('virtuemart_userinfo_id');

//Lets do it dirty for now
//$userModel = VmModel::getModel('user');
$msg = '';
if ( isset($virtuemart_userinfo_id) && $virtuemart_user_id != 0 ) {
//$userModel -> deleteAddressST();
$q = 'DELETE FROM #__virtuemart_userinfos  WHERE virtuemart_user_id="'. $virtuemart_user_id .'" AND virtuemart_userinfo_id="'. $virtuemart_userinfo_id .'"';
$db->setQuery($q);
$db->query();

$msg = vmInfo('Address has been successfully deleted.');
}
$layout = JRequest::getWord('layout','edit');
$this->setRedirect('index.php?option=com_virtuemart&view=user&task=edit&virtuemart_user_id[]='.$virtuemart_user_id, $msg);
}


You should now be able to delete Shipping Address in the admin.

Could a DevTeam member please verify this, I don't want this to get wiped on the next update?

I hope this helps.

ivus

  • Full Member
  • ***
  • Posts: 534
  • - YAY me... proud member of the 500 club...
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #6 on: July 24, 2012, 03:44:23 am »
Dammit... now I can't add a new SHIPPING ADDRESS.

Seems the required field for STATE/PROVINCE/REGION isn't populating when I select a COUNTRY...? I'm in Australia.

Anyone else getting this?

ivus

  • Full Member
  • ***
  • Posts: 534
  • - YAY me... proud member of the 500 club...
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #7 on: July 24, 2012, 04:06:32 am »
OK... got to the bottom of it, but not sure how to fix it.

So the NEW SHIPPING ADDRESS edit is done inside the SHIPMENT ADDRESS tab (tab 2)... however there's also a country and state fields in the ADDITIONAL INFORMATION tab (tab 1)... looks like when you select a country in tab 2, it updates that state field in tab 1... field name conflict.

Is there a fix for this?

serapol

  • Beginner
  • *
  • Posts: 43
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #8 on: July 24, 2012, 08:35:03 am »
no other way round, change the link in shopfunctions.php line 626 to &task=removeAddressST

it seemed easier to rename the function, but you can replace the link :)

ivus

  • Full Member
  • ***
  • Posts: 534
  • - YAY me... proud member of the 500 club...
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #9 on: July 24, 2012, 08:50:05 am »
Hi serapol,

Yes I saw that and raised with a:

Quote
I can see it in the front but I can't find it in the back? So changing the link still does nothing?

I also fixed it myself and found other issues which is what I'm waiting on now. I'm not sure if my update was incomplete or that this bug actually exists as no one else has gotten back to me about it yet. Since you've paid some interest, perhaps you could test it on your site to see if the issue exists for you too? and then get back to me so I can action it further.

I also wonder if VM has an SVN repository I can tap into... might go found out while I wait.

 ;)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9913
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

seweryn

  • Jr. Member
  • **
  • Posts: 57
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #11 on: August 16, 2012, 08:43:47 am »
Hello,

This work, but I use SEO url's - then it not work.

It use for example: ".../editaddressBT?virtuemart_user_id[0]=889&virtuemart_userinfo_id=12"

I change in components/com_virtuemart/router.php in line 203:

"editaddressBT" to "deleteaddressST" - it work fine, but I don't know if I maybe injure the other functionality.

Could you help?

Sorry for my english.

Thanks a lot.
I use VirtueMart 2.0.22c & Joomla 2.5.14

Doeke Norg

  • Beginner
  • *
  • Posts: 17
    • SQUID Media
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #12 on: October 11, 2012, 11:08:33 am »
I found out that there is a typo in router.php and this is why the delete link isn't working. It isn't a solution to the ability to remove the shipping address but at least the link will be correct.

Code: [Select]
else if($query['task']='editaddress'){
must be
Code: [Select]
else if($query['task']=='editaddress'){

The fix for actually removing the address must be changed in components/com_virtuemart/controllers/user.php.
Code: [Select]
function removeAddressST(){ must become
Code: [Select]
function deleteAddressST(){
Now you won't be able to CREATE a new address. Which needs to be fixed in components/com_virtuemart/views/user/view.html.php around line 154.
Code: [Select]
   $task = 'editAddressSt';must become
Code: [Select]
   $task = 'editaddressST';


slinkybambi

  • Beginner
  • *
  • Posts: 6
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #13 on: October 18, 2012, 04:03:18 am »
Hi! I am using VM 2.0.12b  and the shipping address is stopping people from being able to place orders. It has been a week now and I am tearing my hair out, can anyone help me?  I have no idea how to fix this and urgently need to delete the shipping address part so that my customers cant see it. HELP!!!!!

mromstoeck

  • Beginner
  • *
  • Posts: 2
Re: BUG. Not work delete additional shipping address (Virtuemart 2.0.8)
« Reply #14 on: November 29, 2013, 16:40:31 pm »
Same problem in VM2 2.0.24.

Fix: Edit line 275 in components/com_virtuemart/controllers/user.php in function removeAddressST():

$userModel->removeAddress($virtuemart_userinfo_id);