- Posts: 10
- Thank you received: 0
Getting the Prices of a Product
11 years 8 months ago #185697
by philipp
Getting the Prices of a Product was created by philipp
-- HikaShop version -- : latest
-- Joomla version -- : latest
-- PHP version -- : latest
-- Browser(s) name and version -- : modern html 5 browser
Hello Everybody,
I am about to create a View for a certain product collection… Well, I could manage to retrive the list of products from the database, so I have each nessesary »product_id«.
Is there a function I can use to get the prices of each Product, or do I have to code that myself?
Have a look at the attachment, I am interessted in the Prices Array, how can I get that?
-- Joomla version -- : latest
-- PHP version -- : latest
-- Browser(s) name and version -- : modern html 5 browser
Hello Everybody,
I am about to create a View for a certain product collection… Well, I could manage to retrive the list of products from the database, so I have each nessesary »product_id«.
Is there a function I can use to get the prices of each Product, or do I have to code that myself?
Have a look at the attachment, I am interessted in the Prices Array, how can I get that?
Please Log in or Create an account to join the conversation.
11 years 8 months ago #185713
by nicolas
Replied by nicolas on topic Getting the Prices of a Product
Hi,
Once you have the product data in a $product variable you can use that code:
Once you have the product data in a $product variable you can use that code:
Code:
<?php
$productClass = hikashop_get('class.product');
$ids = array($product->product_id);
$config = hikashop_config();
$main_currency = $config->get('main_currency');
$discount_before_tax = $config->get('discount_before_tax');
$productClass->getPrices($product, $ids,hikashop_getCurrency(), $main_currency, hikashop_getZone(), $discount_before_tax);
var_dump($product->prices);
?>
Please Log in or Create an account to join the conversation.
Time to create page: 0.179 seconds