main product

  • Posts: 22
  • Thank you received: 0
7 years 6 months ago #281335

-- HikaShop version -- : 3.2.0
-- Joomla version -- : 3.8.1
-- PHP version -- : 7
-- Browser(s) name and version -- : firefox57

Hello
I want get main product price in php override
I create some variant and getting variant price with format by code:

echo $this->currencyHelper->format(@$price->price_value_with_tax,$price->price_currency_id);
I need get main product price that is no variant
this price is with tax
please tell me how I can get main product price with format and currency unit and seprator such as above code
thanks

Please Log in or Create an account to join the conversation.

  • Posts: 26232
  • Thank you received: 4035
  • MODERATOR
7 years 6 months ago #281346

Hello,

When your "element" is a variant, you can access to its parent prices with :

$this->element->main->prices
Please note that "prices" is an array of prices and you need to perform a loop on them or just take the first element (with "reset()") in order to be able to use the code you posted.

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.

  • Posts: 22
  • Thank you received: 0
7 years 6 months ago #281394

Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum