Skip to main content

Separate price and currency

More
11 years 5 months ago - 11 years 5 months ago #200665 by kun333
-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3
-- PHP version -- : 5.3
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : Hello!
I'm need to display separately "price" and "currency" because i want to insert microdata for "offers/price" and "offers/priceCurrency/" How i can display price and currency in individual 's?

like this:

Hello!
I'm need to display separately "price" and "currency" because i want to insert microdata for "offers/price" and "offers/priceCurrency/" How i can display price and currency in individual <span>'s?

like this:
Code:
<span id="hikashop_product_price_with_options_main" class="hikashop_product_price_with_options_main"> <span class="hikashop_option_price_title">Цена:</span> <span class="hikashop_option_price_value"><span itemprop="price">4 000,00</span> <span itemprop="currency">USD</span> </span>


View - option price.php
Last edit: 11 years 5 months ago by kun333.

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

More
11 years 5 months ago #200670 by nicolas
Replied by nicolas on topic Separate price and currency
Hi,

HikaShop already has microdata which supports prices with their currency. You can simply enable the microdata plugin via the Joomla plugins manager for that.
So you shouldn't have to do that.

If nevertheless you want to do it with custom code, you should do differently and instead of separating the price and the currency, you should add such tag in the views where the prices are added:
Code:
<?php $currency_id = hikashop_getCurrency(); $null = null; $currencyClass = hikashop_get('class.currency'); $currencies = $currencyClass->getCurrencies($currency_id,$null); $data=$currencies[$currency_id]; ?> <meta itemprop="priceCurrency" content="'.$data->currency_code.'" />

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

Time to create page: 0.138 seconds
Powered by Kunena Forum