Author Topic: Showing quantity price table - js-recalculate  (Read 1422 times)

JestaBlunt

  • Beginner
  • *
  • Posts: 35
  • Skype Name: donjestablunt
Showing quantity price table - js-recalculate
« on: April 05, 2016, 23:03:20 pm »
hi,

i have the following problem: i have set up a price table to be shown (page is in german, i try to translate ;) )

1 piece € 1,19
From 100 pieces € 1,00

it working. but when i add a custom string which is changing the price (here "silver-water" adding +5 €, the calculated price isnt changing, only the one create with "createpricediv".

is there a way to make the self-produced price dynamic?

Code: [Select]
foreach ($product->allPrices as $key => $price) {
$itemCnt++;
if ($price["price_quantity_start"] != 0 ) {
if ( $itemCnt == 1 ) {
echo $price["price_quantity_start"]." Stk. <strong>€&nbsp;".number_format($price["product_price"],2,',','.')."</strong><br/>";
}
else {
echo "Ab ".$price["price_quantity_start"]." Stk. <strong class='price_discount'>€&nbsp;".number_format($price["product_price"],2,',','.')."/Stk.</strong><br/>"; }
}
else {
echo "1 Stk. <strong>".$currency->createPriceDiv ('priceWithoutTax', '', $product->prices)."</strong><br/>";


}
}

Test-product:
http://bp-gerd-test.pachlerschatek.at/index.php/fruchtsaft-erdbeer-pago-0,2literew-54-1255-detail

VM 3.0.14
Joomla 3.5.0

thx,
peace jesta

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4026
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Showing quantity price table - js-recalculate
« Reply #1 on: April 09, 2016, 21:21:39 pm »
The simplest way, is to use same class as createprice div use.
When you have a price update, this check for the class > PricesalesPrice for eg.
This need to be in a container class > product-price
so if your own price use for salesPrice eg.
Code: [Select]
<div class="product-price"><span class="PricesalesPrice">10.0€</span></div>This should update. same time as original salesPrice

This are all value that can be returned and most can be used same way depending your VM config :
basePrice
basePriceVariant
basePriceWithTax
discountAmount
discountedPriceWithoutTax
messages
priceWithoutTax
salesPrice
salesPriceWithDiscount
taxAmount
unitPrice
variantModification