Author Topic: How to detect Virtuemart account/addST? Page  (Read 271 times)

lebogang

  • Beginner
  • *
  • Posts: 7
  • A beginner
How to detect Virtuemart account/addST? Page
« on: July 26, 2018, 12:37:57 pm »
Good day

I want to hide the list of shipment address on User maintenance page when  the user is adding a new shipping address or when they edit an existing address

I am using VirtueMart 3.2.14 and Joomla version, 3.8.10.

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1794
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: How to detect Virtuemart account/addST? Page
« Reply #1 on: July 26, 2018, 12:59:55 pm »
Try this :

Code: [Select]
$view = vRequest::getCmd('view','');
$task = vRequest::getCmd('task','');
$new = vRequest::getCmd('new','');

if ($view=='user' and $task=='addST') {
  if ($new==1) {
    // User adding a new ST address, do what yo need to do
  }
  else {
    // User editing a ST address, do what you need to do
  }
regards

Jörgen @ Kreativ Fotografi

Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

lebogang

  • Beginner
  • *
  • Posts: 7
  • A beginner
Re: How to detect Virtuemart account/addST? Page
« Reply #2 on: July 26, 2018, 13:18:00 pm »
Thanks, it worked

Code: [Select]
<?php
/**
 *
 * Enter address data for the cart, when anonymous users checkout
 *
 * @package VirtueMart
 * @subpackage User
 * @author Max Milbers
 * @link https://virtuemart.net
 * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * VirtueMart is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * @version $Id: edit_address_addshipto.php 9413 2017-01-04 17:20:58Z Milbo $
 */
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
?>




<fieldset>
<legend>
<?php 

/*echo '<span class="userfields_info">'.vmText::_('COM_VIRTUEMART_USER_FORM_SHIPTO_LBL').'</span> ';*/

?>



    <?php 
    
  $view 
vRequest::getCmd('view','');
$task vRequest::getCmd('task','');
$new vRequest::getCmd('new','');

if (
$view=='user' and $task=='addST') {
  echo 
'';
  }
  
    else
    {
        echo 
'<fieldset><legend class="userfields_info">Delivery Addresses</legend></fieldset>';
        echo 
$this->lists['shipTo'];
    }
    
     
?>



</legend>
</fieldset>

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1794
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: How to detect Virtuemart account/addST? Page
« Reply #3 on: July 26, 2018, 13:57:00 pm »
You´re welcome :)

Jörgen @ Kreativ Fotografi
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)