News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How to show B2B prices without VAT but with VAT when in cart

Started by appletree, November 12, 2012, 16:19:24 PM

Previous topic - Next topic

appletree

Using Joomla 2.5.6. en VM 2.0.10 en PHP 5.3.17


I want a B2B shop which shows only prices excl VAT  (BTW in Dutch) in the shop.
When someone checks out then he has to see totalprice and VAT and off course total price incl. VAT.
See the screenshot (which is good)

I can't get it right. When it is good in the shop, then there are no prices at all in the Check-out.
If I have the Check-out OK, then I have the wrong prices and the VAT at the articles in the shop. (see prices1.jpg)
Is there a setting so I can see prices without VAT and in the checkout with VAT?  (is normal B2B)

And one other thing: the shoppingcart module shows a price inclusive VAT. That is not what I want. (see prices2.jpg)

I have Shopper Group Details (group: default) turned 'on' and this is showing prices. All settings influenced the shop and the Checkout.
(see prices3.jpg)



[attachment cleanup by admin]

seagul

Hi,
I have a similar setup.
Try to deactivate "Show VAT in cart" in configuration on the left.
It should still show the Total VAT in the cart but not in the lines.
Hope that helps.
Sigrid

appletree

Hello Sigrid,
Thanks, I have deactivate 'Show tax in cart' Result: no prices in the shop and no prices at all in the Check-out (no price and no VAT - nothing) So this is not working.

I was not logged in as customer. When I logged in, then I see per article only a price and total price in the Check-out, but no VAT. And  total price incl VAT from all products. But VAT is not showing.  In the shop I see total sales price, netto price (excl VAT) and VAT. (but I want only netto price)

But I have seen a Joomla site with VM with B2B shop and correct prices, so it must be possible. But how?

seagul

I can tell what you what I have done.
My configuration you can find in the attachments.

and I adjusted the following templates with template overrides:
templates/mytemplate/html/com_virtuemart/productdetails/default_showprices.php
<?php
/**
 *
 * Show the product details page
 *
 * @package VirtueMart
 * @subpackage
 * @author Max Milbers, Valerie Isaksen

 * @link http://www.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: default_showprices.php 6347 2012-08-14 15:49:02Z Milbo $
 */
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

?>

<div class="product-price" id="productPrice<?php echo $this->product->virtuemart_product_id ?>">
    <?php
    
if ($this->product->product_unit && VmConfig::get('price_show_packaging_pricelabel')) {
echo "<h4>" JText::_('COM_VIRTUEMART_CART_PRICE_PER_UNIT') . ' (' $this->product->product_unit "):</h4>";
    } else {
echo "<h4>" JText::_('COM_VIRTUEMART_CART_PRICE') . "</h4>";
    }

    if (empty(
$this->product->prices) and VmConfig::get('askprice'1)) {
?>

        <a class="ask-a-question bold" href="<?php echo $url ?>" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE'?></a>
    <?php
    
}
    if (
$this->showBasePrice) {
echo $this->currency->createPriceDiv('basePrice''COM_VIRTUEMART_PRODUCT_BASEPRICE'$this->product->prices);
echo $this->currency->createPriceDiv('basePriceVariant''COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT'$this->product->prices);
    }

    echo 
$this->currency->createPriceDiv('variantModification''COM_VIRTUEMART_PRODUCT_VARIANT_MOD'$this->product->prices);
    
//echo $this->currency->createPriceDiv('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices);
    
echo $this->currency->createPriceDiv('discountedPriceWithoutTax''COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE'$this->product->prices);
    echo 
$this->currency->createPriceDiv('salesPriceWithDiscount''COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT'$this->product->prices);
    echo 
$this->currency->createPriceDiv('priceWithoutTax''COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX'$this->product->prices);
    echo 
$this->currency->createPriceDiv('discountAmount''COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT'$this->product->prices);
    
//echo $this->currency->createPriceDiv('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $this->product->prices);
    //echo $this->currency->createPriceDiv('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices);
echo $this->currency->createPriceDiv('unitPrice''COM_VIRTUEMART_PRODUCT_UNITPRICE'$this->product->prices);
    
?>

</div>


and for my cart module I disabled the sum, was okay for my client.
templates/mytemplate/html/mod_virtuemart_cart/default.php

<?php // no direct access
defined('_JEXEC') or die('Restricted access');

//dump ($cart,'mod cart');
// Ajax is displayed in vm_cart_products
// ALL THE DISPLAY IS Done by Ajax using "hiddencontainer" 
?>


<!-- Virtuemart 2 Ajax Card -->
<div class="vmCartModule <?php echo $params->get('moduleclass_sfx'); ?>" id="vmCartModule">
<?php
if ($show_product_list) {
?>

<div id="hiddencontainer" style=" display: none; ">
<div class="container">
<?php if ($show_price) { ?>
  <div class="prices" style="float: right;"></div>
<?php ?>
<div class="product_row">
<span class="quantity"></span>&nbsp;x&nbsp;<span class="product_name"></span>
</div>

<div class="product_attributes"></div>
</div>
</div>
<div class="vm_cart_products">
<div class="container">
<?php foreach ($data->products as $product)
{
if ($show_price) { ?>

  <div class="prices" style="float: right;"><?php echo  $product['prices'?></div>
<?php ?>
<div class="product_row">
<span class="quantity"><?php echo  $product['quantity'?></span>&nbsp;x&nbsp;<span class="product_name"><?php echo  $product['product_name'?></span>
</div>
<?php if ( !empty($product['product_attributes']) ) { ?>
<div class="product_attributes"><?php echo $product['product_attributes'?></div>

<?php }
}
?>

</div>
</div>
<?php ?>

<div class="total" style="float: right;">
<?php if ($data->totalProduct and $show_price) echo  $data->billTotal?>
</div>
<div class="show_cart">
<?php echo $data->cart_show?>
</div>
<div style="clear:both;"></div>

<noscript>
<?php echo JText::_('MOD_VIRTUEMART_CART_AJAX_CART_PLZ_JAVASCRIPT'?>
</noscript>
</div>



If you find a better way, please let me know :-).
Sigrid

[attachment cleanup by admin]

seagul

Forgot something:
You have to setup the VAT as "tax per bill" (not "tax per Product) in the "taxes and calculation rules".

appletree

Hello Seagul
Thanks for your help.
The 'setup the VAT as "tax per bill" ' is working fine.
I still have not the right prices in the shop. I will show some pictures within a few days.