seba castelao Posted December 21, 2016 Share Posted December 21, 2016 Hola, mi nombre es Sebastian. Tengo una tienda que trabaja con moneda principal Dolares, y como moneda secundaria $ pesos argentinos. Me gustaria exhibir la cotizacion del cambio de moneda en la parte del header. Como tendria que ser el codigo para traer el valor de la celda conversion_rate ??? desde ya muchas gracias. La version de Presta es la 1.6.1.10 Link to comment Share on other sites More sharing options...
ventura Posted December 21, 2016 Share Posted December 21, 2016 Prueba algo asi: {foreach from=$currencies item=row name="currencies"} {if $row.id_currency != $currency->id} <p> {$row.name} : {convertPriceWithCurrency price= $row.conversion_rate}</p> {/if} {/foreach} 1 Link to comment Share on other sites More sharing options...
seba castelao Posted December 21, 2016 Author Share Posted December 21, 2016 Muchas gracias por tu respuesta!!!! Casi perfecto. El unico defecto que tiene es que me muestra la cotizacion contraria a la moneda seleccionada, me explico ? Link to comment Share on other sites More sharing options...
ventura Posted December 22, 2016 Share Posted December 22, 2016 Puedes probar con este codigo tambien, es lo que se suele utilizar para mostrar las conversiones de moneda Para dos monedas seria algo así {if $currency->id == Configuration::get('PS_CURRENCY_DEFAULT')} {assign var='conversion_quantity' value= 1 * $currencies[0].conversion_rate} {l s='1 %s' sprintf=$currency->name|escape} = {$conversion_quantity|string_format:"%.2f"} {$currencies[0].iso_code} {else} {assign var='conversion_quantity' value= 1 / $currencies[0].conversion_rate} {l s='1 %s' sprintf=$currency->name|escape} = {$conversion_quantity|string_format:"%.2f"} {$currencies[1].iso_code} {/if} Link to comment Share on other sites More sharing options...
seba castelao Posted December 26, 2016 Author Share Posted December 26, 2016 Perfecto, a funcionado de diez, muchisimas gracias Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now