[Skip to main content](#vessel-content)

#   main product

##

- **[behvandi](/forum/user/49760-behvandi "View behvandi's Profile")**
- [![behvandi's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/49760-behvandi "View behvandi's Profile") Topic Author
- [ Offline](/forum/user/49760-behvandi)

Less More

- Posts: 22
- Thank you received: 0
-
-

9 years 1 month ago [\#281335](#281335) by [behvandi](/forum/user/49760-behvandi "View behvandi's Profile")  *[main product](/forum/26-product-category-display/892531-main-product#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:  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")* was created by *[behvandi](/forum/user/49760-behvandi "View behvandi's Profile")*

-- 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: Code:

echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value_with_tax,$price-&gt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTI1MzEtbWFpbi1wcm9kdWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 1 month ago [\#281346](#281346) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[main product](/forum/26-product-category-display/892531-main-product#281346 "-- 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:  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")*

Hello,

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

$this-&gt;element-&gt;main-&gt;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 &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTI1MzEtbWFpbi1wcm9kdWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[behvandi](/forum/user/49760-behvandi "View behvandi's Profile")**
- [![behvandi's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/49760-behvandi "View behvandi's Profile") Topic Author
- [ Offline](/forum/user/49760-behvandi)

Less More

- Posts: 22
- Thank you received: 0
-
-

9 years 1 month ago [\#281394](#281394) by [behvandi](/forum/user/49760-behvandi "View behvandi's Profile")  Replied by *[behvandi](/forum/user/49760-behvandi "View behvandi's Profile")* on topic *[main product](/forum/26-product-category-display/892531-main-product#281394 "-- 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:  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")*

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTI1MzEtbWFpbi1wcm9kdWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.061 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
