Price information from another component
12 years 10 months ago #132071
by esotechie
Price information from another component was created by esotechie
Hi
I am accessing the product information from another component to display in a scroller with certain effects not available on the standard one.
I have successfully got the product name and image loading, but wanted to know where to get the best code to use for fetching the price, which takes into account the currency and discounts.
Thanks in advance
I am accessing the product information from another component to display in a scroller with certain effects not available on the standard one.
I have successfully got the product name and image loading, but wanted to know where to get the best code to use for fetching the price, which takes into account the currency and discounts.
Thanks in advance
Please Log in or Create an account to join the conversation.
12 years 10 months ago #132144
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Price information from another component
Hi,
If you want to load an HikaShop product, the best is to use the HikaShop product class.
It will load the values from the different tables (product, product_price, etc).
Regards,
If you want to load an HikaShop product, the best is to use the HikaShop product class.
Code:
$productClass = hikashop_get('class.product');
$product = $productClass->get($product_id);
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
12 years 10 months ago #132164
by esotechie
Replied by esotechie on topic Price information from another component
Thank you for the quick response Jerome. I'll give that a go
Please Log in or Create an account to join the conversation.
12 years 10 months ago #132871
by esotechie
Replied by esotechie on topic Price information from another component
The line $productClass = hikashop_get('class.product'); crashes the page.
Please Log in or Create an account to join the conversation.
12 years 10 months ago #132961
by nicolas
Replied by nicolas on topic Price information from another component
Of course you need to initialize HikaShop before calling HikaShop functions.
You can initialize HikaShop with that line of code:
You can initialize HikaShop with that line of code:
Code:
if(!include_once(rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_hikashop'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php')) return true;
Please Log in or Create an account to join the conversation.
Time to create page: 0.169 seconds