News:

Looking for documentation? Take a look on our wiki

Main Menu

Show Bulk Range and its Discount-Price in Product Details

Started by JestaBlunt, April 20, 2015, 14:27:00 PM

Previous topic - Next topic

JestaBlunt

hi,

i need to show the bulk range and the altered price for that range in the product details. it should be like "
1 Item for € 3,99
10 Items for €25,--
100 Items for € 200,--

I could make it static, but i would like to print out the text dynamically from the data from VM. where are those stored? how can i access them?

hope someone can help.

thx
jesta

ps: the field in the backend has the name "mprices[price_quantity_start][]". is there a way to guess how i access it for the frontend from the name?

JestaBlunt

i've gone through the prices with:


foreach ($product->prices as $key => $price) {
  echo $key." ".$price."<br/>";
}


It shows:

virtuemart_product_price_id 2
virtuemart_product_id 1
virtuemart_shoppergroup_id 0
product_price 2.990000
override 0
product_override_price 0.00000
product_tax_id 1
product_discount_id 0
product_currency 47
product_price_publish_up 0000-00-00 00:00:00
product_price_publish_down 0000-00-00 00:00:00
price_quantity_start 1
price_quantity_end 10

created_on 2015-04-17 09:13:59
created_by 696
modified_on 2015-04-20 11:49:29
modified_by 696
locked_on 0000-00-00 00:00:00
locked_by 0
costPrice 2.99
basePrice 2.99
basePriceVariant 2.99
basePriceWithTax 3.588
discountedPriceWithoutTax 2.99
priceBeforeTax 2.99
salesPrice 3.588
taxAmount 0.598
salesPriceWithDiscount 0
salesPriceTemp 3.588
unitPrice 0
priceWithoutTax 2.99
discountAmount 0
variantModification 0
DBTax Array
Tax Array
VatTax Array
DATax Array

so i have my standard price, which ranges from 1 to 10, which seems to have the id 0 (product_discount_id). but how do i get to my second discount, which ranges from 10 to unlimited?

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

JestaBlunt

woha, i did it...with that


foreach ($product->allPrices as $key => $price) {
  echo $price["price_quantity_start"]." Stk. ab <strong>€ ".round($price["product_price"],$currency->_priceConfig['salesPrice'][1])."</strong><br/>";
}