Post by xdomofab » Sun Apr 26, 2015 6:29 pm

I wanted to add the currency code to product.tpl on Opencart 2.0:

Code: Select all

<?php echo $this->currency->getCode(); ?>
it does not work on Opencart 2.0, how to fix it?

Opencart Development & Consult:
All in One SEO Package: making your Opencart SEO friendly
Product Rich Snippets: Breadcrumb, Product & Product Reviews
Custom Titile H1 Tag: custom category title, h1, bottom description and product title
Optimize Site URL Architecture: unique url w/breadcrumb, seo friendly url architecture


New member

Posts

Joined
Wed Jun 05, 2013 11:03 am

Post by OSWorX » Sun Apr 26, 2015 6:44 pm

You are selling expensive extensions and asking here for to help you?

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by rph » Sun Apr 26, 2015 8:50 pm

All data needs to be injected into the view in 2.x. You can't directly access the service locator from it anymore.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by Pobb » Tue Apr 28, 2015 8:50 pm

Try putting this in controller > product.php

Code: Select all

$data['code'] = $this->currency->getCode();
and then in your product.tpl

Code: Select all

<?php echo $data['code']; ?>

Active Member

Posts

Joined
Tue May 31, 2011 2:35 pm

Post by sans » Tue Mar 08, 2016 8:47 pm

How to i get currency code for opencart 2.2.0.0?
I am try this code :

Code: Select all

$data['code'] = $this->currency->getCode();
But i get error.

kaos jersey, jersey bola, baju bola, baju bola terbaru, baju bola murah


Active Member

Posts

Joined
Tue Dec 07, 2010 9:18 am

Post by ocart777 » Tue Mar 08, 2016 9:26 pm

sans wrote:How to i get currency code for opencart 2.2.0.0?
I am try this code :

Code: Select all

$data['code'] = $this->currency->getCode();
But i get error.

Code: Select all

$data['code'] = $this->session->data['currency'];

You can't control the weather, but you can change your mood.
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.


OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE


User avatar
Active Member

Posts

Joined
Mon Jun 10, 2013 4:57 pm
Location - Malaysia
Who is online

Users browsing this forum: No registered users and 42 guests