VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: lebogang on July 26, 2018, 12:37:57 PM

Title: How to detect Virtuemart account/addST? Page
Post by: lebogang 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.
Title: Re: How to detect Virtuemart account/addST? Page
Post by: Jörgen on July 26, 2018, 12:59:55 PM
Try this :

$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

Title: Re: How to detect Virtuemart account/addST? Page
Post by: lebogang on July 26, 2018, 13:18:00 PM
Thanks, it worked

<?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>

Title: Re: How to detect Virtuemart account/addST? Page
Post by: Jörgen on July 26, 2018, 13:57:00 PM
You´re welcome :)

Jörgen @ Kreativ Fotografi