Virtuemart 2 - Remover "adicionar/editar endereços" no cesto

  • claujohnson
  • Avatar de claujohnson Autor do Tópico
  • Offline
  • JCB! Colaborador
  • JCB! Colaborador
Mais
13 anos 3 semanas atrás #79964 por claujohnson
claujohnson created the topic: Virtuemart 2 - Remover "adicionar/editar endereços" no cesto
Olá,

Alguém sabe como retirar do carrinho de compras as duas opções "adicionar/editar endereço..." que aparecem bem em cima do carrinho. Gostaria que elas aparecessem somente após o internauta se logar.

Gostaria de deixar o carrinho o mais clena possível. Já tentei retirar essas opções no arquivo do template, mas aí ela some de vez e eu preciso que ela apareça quando o internauta se logar.

obrigado.

Cláudio Araújo
[url=http://www.claudioaraujo.net:2j72kpmk]www.claudioaraujo.net[/url:2j72kpmk]

Please Entrar ou Registrar to join the conversation.


Mais
12 anos 9 meses atrás #84014 por luizwbr
luizwbr replied the topic: Re: Virtuemart 2 - Remover "adicionar/editar endereços" no ces
Olá @claujohnson.

Pra fazer isso, edita o arquivo default_pricelist.php na pasta /components/com_virtuemart/views/cart/

Antes desta classe:
<div class="billto-shipto">

Acrescenta um IF que irá ser mostrado somente após o usuário clicar no botão pra finalizar a compra.

Fica assim o começo:
if ($this->checkout_task==='confirm') {

	?>
	<div class="billto-shipto">
		<div class="width50 floatleft">

			<span><span class="vmicon vm2-billto-icon"></span>
			<?php echo JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_LBL'); ?></span>
			<?php // Output Bill To Address ?>
			<div class="output-billto">
			<?php

			foreach($this->cart->BTaddress&#91;'fields'&#93; as $item){
				if(!empty($item&#91;'value'&#93;)){
					if($item&#91;'name'&#93;==='agreed'){
						$item&#91;'value'&#93; =  ($item&#91;'value'&#93;===0) ? JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_NO'):JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_YES');
					}
					?><!-- span class="titles"><?php echo $item&#91;'title'&#93; ?></span -->
						<span class="values vm2<?php echo '-'.$item&#91;'name'&#93; ?>" ><?php echo $this->escape($item&#91;'value'&#93;) ?></span>
					<?php if ($item&#91;'name'&#93; != 'title' and $item&#91;'name'&#93; != 'first_name' and $item&#91;'name'&#93; != 'middle_name' and $item&#91;'name'&#93; != 'zip') { ?>
						<br class="clear" />
					<?php
					}
				}
			} ?>
			<div class="clear"></div>
			</div>

			<a class="details" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT',$this->useXHTML,$this->useSSL) ?>">
			<?php echo JText::_('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL'); ?>
			</a>

			<input type="hidden" name="billto" value="<?php echo $this->cart->lists&#91;'billTo'&#93;; ?>"/>
		</div>

		<div class="width50 floatleft">

			<span><span class="vmicon vm2-shipto-icon"></span>
			<?php echo JText::_('COM_VIRTUEMART_USER_FORM_SHIPTO_LBL'); ?></span>
			<?php // Output Bill To Address ?>
			<div class="output-shipto">
			<?php
			if(empty($this->cart->STaddress&#91;'fields'&#93;)){
				echo JText::sprintf('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_EXPLAIN',JText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL') );
			} else {
				if(!class_exists('VmHtml'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'html.php');
				echo JText::_('COM_VIRTUEMART_USER_FORM_ST_SAME_AS_BT'). VmHtml::checkbox('STsameAsBT',$this->cart->STsameAsBT).'<br />';
				foreach($this->cart->STaddress&#91;'fields'&#93; as $item){
					if(!empty($item&#91;'value'&#93;)){ ?>
						<!-- <span class="titles"><?php echo $item&#91;'title'&#93; ?></span> -->
						<?php
						if ($item&#91;'name'&#93; == 'first_name' || $item&#91;'name'&#93; == 'middle_name' || $item&#91;'name'&#93; == 'zip') { ?>
							<span class="values<?php echo '-'.$item&#91;'name'&#93; ?>" ><?php echo $this->escape($item&#91;'value'&#93;) ?></span>
						<?php } else { ?>
							<span class="values" ><?php echo $this->escape($item&#91;'value'&#93;) ?></span>
							<br class="clear" />
						<?php
						}
					}
				}
			}
			?>
			<div class="clear"></div>
			</div>
			<?php if(!isset($this->cart->lists&#91;'current_id'&#93;)) $this->cart->lists&#91;'current_id'&#93; = 0; ?>
			<a class="details" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&cid&#91;&#93;='.$this->cart->lists&#91;'current_id'&#93;,$this->useXHTML,$this->useSSL) ?>">
			<?php echo JText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL'); ?>
			</a>

		</div>

		<div class="clear"></div>
	</div>
	<?php
}
?>

[b:3ah8ktjp]Luiz F. Weber[/b:3ah8ktjp]
[url:3ah8ktjp]http://weber.eti.br[/url:3ah8ktjp] - blog Virtuemart
[url:3ah8ktjp]http://loja.weber.eti.br[/url:3ah8ktjp] - plugins VM
[url:3ah8ktjp]http://webgenium.com.br[/url:3ah8ktjp] - trabalho

Please Entrar ou Registrar to join the conversation.