Post by infocondens » Thu Jan 25, 2018 6:42 pm

I want to show on the Frontend of OC 3 a different currency as default, different from the default currency set in Admin.

In 1.5.6.4 I used this extension https://www.opencart.com/index.php?rout ... n_id=10970

I understand there is another one, more complex, in OC 2.0 https://www.opencart.com/index.php?rout ... n_id=19640

But these vqmod extensions are not working in OC 3.0.2..

How can I update the extensions from above to work as a vqmod extension in OC 3 ?
Or how can I convert them to OCMOD ?
Or.. a third solution..? ;D
Last edited by infocondens on Fri Jan 26, 2018 7:47 am, edited 1 time in total.

New member

Posts

Joined
Sat Sep 27, 2014 8:18 pm


Post by IP_CAM » Fri Jan 26, 2018 5:04 am

Well, as OcMod for OC v.3.0.2.x, it would about look like this,
but I cannot test it, and therefore not know, if this Code:

Code: Select all

elseif($this->currency->getCode() != "EUR") {
$this->currency->set("EUR");
will work in OC-3, as it comes, everything else matches OC-3 Code.

Good Luck! ;)
Ernie
---
PS: I addressed this file:
catalog/controller/common/currency.php
and not this:
catalog/controller/api/currency.php
just to mention this too! :D
---
File name:
frontside_default_currency.ocmod.xml
---

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
<name><![CDATA[frontside default currency]]></name>
<version><![CDATA[OC v.3.0.2.x]]></version>
<code><![CDATA[frontside_default_currency]]></code>
<author><![CDATA[Ernie - IP_CAM]]></author>

<file path="catalog/controller/common/currency.php">
<operation>
<search><![CDATA[$this->load->language('common/currency');]]></search>
<add position="before"><![CDATA[
	elseif($this->currency->getCode() != "EUR") {
	$this->currency->set("EUR");
				
	unset($this->session->data['shipping_method']);
	unset($this->session->data['shipping_methods']);

	if (isset($this->request->post['redirect'])) {
	$this->response->redirect($this->request->post['redirect']);
	} else {
	$this->response->redirect($this->url->link('common/home'));
	}
}
]]></add>
</operation>
</file>
</modification>
---

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by infocondens » Fri Jan 26, 2018 8:04 am

thanks for the answer and the effort !

I made a file with that name and that code.. how do I install it in OC 3 ? In Admin I can not upload an ocmod.xml file..

New member

Posts

Joined
Sat Sep 27, 2014 8:18 pm


Post by IP_CAM » Sat Jan 27, 2018 12:05 pm

Well, you should be able by use of the OC Modification Installer.
And if you use VqMod as well, then clean out the vqmod/vqcache/...
Section as well first, before clearing out the Browser Cache too, to make
sure, it will display the latest Code.
Good Luck! ;)
Ernie
---
Image

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by rayeln » Tue Feb 27, 2018 11:12 pm

IP_CAM wrote:
Sat Jan 27, 2018 12:05 pm
Well, you should be able by use of the OC Modification Installer.
And if you use VqMod as well, then clean out the vqmod/vqcache/...
Section as well first, before clearing out the Browser Cache too, to make
sure, it will display the latest Code.
Good Luck! ;)
Ernie
---
Image
hi, IP_CAM,

I have tried transfer your xml file to Zip file and uploaded, but did show up in the Modification List after that, very strange. And nothing works. if it is possible that just show me the final currency.php and I can edit this file directly. Many thanks in advance!

Newbie

Posts

Joined
Mon Feb 26, 2018 8:04 pm

Post by IP_CAM » Wed Feb 19, 2020 11:02 am

Well, I have never played around with latest Version 3.0.3.2, but most likely,
the Mod shown above will not work, as it comes. Sorry, but I can't help on this.
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: gazih and 39 guests