News:

Looking for documentation? Take a look on our wiki

Main Menu

remove price from parent

Started by dsrpmedia, June 20, 2012, 00:26:13 AM

Previous topic - Next topic

dsrpmedia

Hi

I have figured out how to stop the parent from being added to the cart / appearing in the child products dropdown,
(see http://forum.virtuemart.net/index.php?topic=100330.0 )

now I also need to stop the parent from displaying a price if it has children (I have the child product price displaying in the dropdown)

any suggestions would be greatly appreciated

dsrpmedia

#1
ok, I think I know what to do - I just don `t know how to do it

I need a statement for the file default_showprices.php that says if a parent has children do nothing, otherwise load the pricing code eg
  <?php
    
if ($this->parent has child { do nothing

else

<
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 "<strong>" . JText::_('COM_VIRTUEMART_CART_PRICE_PER_UNIT') . ' (' . $this->product->product_unit . "):</strong>";
    
} else {
// echo "<strong>" . JText::_('COM_VIRTUEMART_CART_PRICE') . "</strong>";
    
}

    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('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $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);
    
?>

</div>

  ?>



if anyone could tell me how to do that if/else statement I would REALLY appreciate it.

Thank you