Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Intelliants
E-commerce Script
Commits
7f7fbc6b
Commit
7f7fbc6b
authored
Aug 21, 2017
by
Janur J.
Browse files
Multiple currencies support by shopping cart
parent
fb27cb41
Changes
6
Hide whitespace changes
Inline
Side-by-side
includes/classes/ia.front.cart.php
View file @
7f7fbc6b
...
...
@@ -170,6 +170,26 @@ class iaCart extends abstractModuleFront
return
$rows
;
}
protected
function
_processValues
(
&
$rows
,
$singleRow
=
false
,
$fieldNames
=
[])
{
parent
::
_processValues
(
$rows
,
$singleRow
,
$fieldNames
);
if
(
$rows
)
{
$singleRow
&&
$rows
=
[
$rows
];
$iaCurrency
=
$this
->
iaCore
->
factory
(
'currency'
);
$currency
=
$iaCurrency
->
get
();
foreach
(
$rows
as
&
$row
)
{
$row
[
'price_formatted'
]
=
$iaCurrency
->
format
(
$row
[
'price'
]);
$row
[
'currency'
]
=
$currency
;
}
$singleRow
&&
$rows
=
array_shift
(
$rows
);
}
}
protected
function
_summarize
(
$cartId
)
{
$items
=
$this
->
_getItems
(
$cartId
);
...
...
includes/classes/ia.front.product.php
View file @
7f7fbc6b
...
...
@@ -153,7 +153,7 @@ class iaProduct extends abstractModuleFront
if
(
$rows
)
{
$singleRow
&&
$rows
=
[
$rows
];
$iaCurrency
=
$this
->
iaCore
->
factory
Module
(
'currency'
,
$this
->
getModuleName
()
);
$iaCurrency
=
$this
->
iaCore
->
factory
(
'currency'
);
$currency
=
$iaCurrency
->
get
();
...
...
install.xml
View file @
7f7fbc6b
...
...
@@ -263,6 +263,11 @@
<hooks>
<hook
name=
"phpCoreUrlRewrite"
page_type=
"front"
filename=
"hook.url-rewrite"
>
<![CDATA[]]>
</hook>
<hook
name=
"phpCoreBeforePageDisplay"
page_type=
"front"
filename=
"hook.blocks-load"
>
<![CDATA[]]>
</hook>
<hook
name=
"phpFrontCurrencyChanged"
page_type=
"front"
>
<![CDATA[
$iaCore->
factoryModule('cart', 'commerce')->recount();
]]>
</hook>
<hook
name=
"smartyAdminAfterHeadSection"
type=
"smarty"
>
<![CDATA[
<style type="text/css">
...
...
templates/front/cart.tpl
View file @
7f7fbc6b
...
...
@@ -20,7 +20,7 @@
{
lang
key
=
'update_cart'
}
</button>
</p>
<p
class=
"lead"
>
{
lang
key
=
'total'
}
:
<span
class=
"js-cart-placeholder-total"
>
{
$total
}
</span>
{
$core.config.currency
}
</p>
<p
class=
"lead"
>
{
lang
key
=
'total'
}
:
<span
class=
"js-cart-placeholder-total"
>
{
$total
|
currency_format
}
</span>
</p>
</td>
</tr>
</table>
...
...
templates/front/list-cart.tpl
View file @
7f7fbc6b
...
...
@@ -15,7 +15,7 @@
</div>
</td>
<td
class=
"text-right"
>
<strong>
{($item.price*$item.qty)|
number
_format}
</strong>
<strong>
{($item.price*$item.qty)|
currency
_format}
</strong>
</td>
<td
class=
"text-center delete-item"
><a
href=
"#"
class=
"js-cmd-remove-item"
data-id=
"
{
$item.id
}
"
data-item_id=
"
{
$item.item_id
}
"
><i
class=
"fa fa-remove"
></i></a></td>
</tr>
\ No newline at end of file
templates/front/view.tpl
View file @
7f7fbc6b
...
...
@@ -24,7 +24,6 @@
<span
itemprop=
"priceCurrency"
>
{
$item.currency
}
</span>
</p>
</div>
</div>
<div>
<input
type=
"hidden"
id=
"input-id"
value=
"
{
$item.id
}
"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment