News:

Support the VirtueMart project and become a member

Main Menu

Remove Billing adress from Virtuemart cart

Started by Artanis, April 22, 2012, 02:17:53 AM

Previous topic - Next topic

Artanis

Hello!

I'm building simple internet shop, and as all customers will be private clients and shipping address always will be the same as billing address, I want to completly remove billing address.
I already found that to remove billing address field and button from cart view I needed to remove portion of code from /components/com_virtuemart/views/cart/tmpl/default_pricelist.php :

<div class="output-billto">
<?php

foreach($this->cart->BTaddress['fields'] as $item){
if(!empty($item['value'])){
if($item['name']==='agreed'){
$item['value'] =  ($item['value']===0) ? JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_NO'):JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_YES');
}
?>
<!-- span class="titles"><?php echo $item['title'?></span -->
<span class="values vm2<?php echo '-'.$item['name'?>" ><?php echo $this->escape($item['value']) ?></span>
<?php if ($item['name'] != 'title' and $item['name'] != 'first_name' and $item['name'] != 'middle_name' and $item['name'] != '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['billTo']; ?>"/>
</div>


BUT it seems a bit more tricky, because as soon as I enter shipping address and click Next, Virtuemart asks for billing address anyway.
So - I need to get rid of billing address at all - I dont want to see it in cart (already done), no asking afterwards, and no problems by the end in invoice, etc.

Is it possible? What files needs to be edited to get rid from billing address?

Any helpful answer will be highly appreciated. Best regards, Arthur.

[attachment cleanup by admin]
Animus Project - Design Studio
Running Joomla 2.5.6, Virtuemart 2.0.6a, PHP 5.3.10

patrik60

Try to remove shipment address instead of billing address. This should work because it's the billing address which is required. You may override the language string for the billing address.