Hi guys,
Tried searching all last night, could only find this: http://forum.opencart.com/viewtopic.php?t=1210
That post is dated and Opencart system has changed since then, so I need some help please?
I am in no way a php coder, so please be gentle!
I want to do the same though, move the currency to display ONLY on the product page,
Next to the price or something, I tried a few copy paste experiments from header.tpl to product.tpl, but alas, no joy.
I am on the latest Opencart.
Any help would be greatly appreciated.
Many thanks in advance!
H.
Last edited by HATEPOLICY on Wed Dec 07, 2011 12:08 am, edited 1 time in total.
Skills: Ripp, copy, paste.
Bump again!
If nobody can provide any support could someone point me to place that can?
cheers.
If nobody can provide any support could someone point me to place that can?
cheers.
Skills: Ripp, copy, paste.
edit catalog/controller/product/product.php
find
add after
edit catalog/view/theme/default/template/product/product.tpl
find
add after
edit catalog/view/theme/default/template/common/header.tpl
find & delete
edit: catalog/view/theme/default/stylesheet/stylesheet.css
find and delete
BACKUP Files first
find
Code: Select all
$this->load->model('catalog/product');
Code: Select all
if (($this->request->server['REQUEST_METHOD'] == 'POST') && isset($this->request->post['currency_code'])) {
$this->currency->set($this->request->post['currency_code']);
unset($this->session->data['shipping_methods']);
unset($this->session->data['shipping_method']);
$this->redirect($this->request->post['redirect']);
}
$this->load->model('localisation/currency');
$this->data['currencies'] = array();
$results = $this->model_localisation_currency->getCurrencies();
foreach ($results as $result) {
if ($result['status']) {
$this->data['currencies'][] = array(
'title' => $result['title'],
'code' => $result['code'],
'symbol_left' => $result['symbol_left'],
'symbol_right' => $result['symbol_right']
);
}
}
find
Code: Select all
<?php if ($price) { ?>
Code: Select all
<?php if (count($currencies) > 1) { ?>
<form action="" method="post" enctype="multipart/form-data">
<div id="currency">
<?php foreach ($currencies as $currency) { ?>
<?php if (isset($currency_code)&&$currency['code'] == $currency_code) { ?>
<?php if ($currency['symbol_left']) { ?>
<a title="<?php echo $currency['title']; ?>"><b><?php echo $currency['symbol_left']; ?></b></a>
<?php } else { ?>
<a title="<?php echo $currency['title']; ?>"><b><?php echo $currency['symbol_right']; ?></b></a>
<?php } ?>
<?php } else { ?>
<?php if ($currency['symbol_left']) { ?>
<a title="<?php echo $currency['title']; ?>" onclick="$('input[name=\'currency_code\']').attr('value', '<?php echo $currency['code']; ?>').submit(); $(this).parent().parent().submit();"><?php echo $currency['symbol_left']; ?></a>
<?php } else { ?>
<a title="<?php echo $currency['title']; ?>" onclick="$('input[name=\'currency_code\']').attr('value', '<?php echo $currency['code']; ?>').submit(); $(this).parent().parent().submit();"><?php echo $currency['symbol_right']; ?></a>
<?php } ?>
<?php } ?>
<?php } ?>
<input type="hidden" name="currency_code" value="" />
<input type="hidden" name="redirect" value="index.php?route=product/product&product_id=<?php echo $this->request->get['product_id']; ?>" />
</div>
</form>
<?php } ?>
find & delete
Code: Select all
<?php if (count($currencies) > 1) { ?>
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
<div id="currency"><?php echo $text_currency; ?><br />
<?php foreach ($currencies as $currency) { ?>
<?php if ($currency['code'] == $currency_code) { ?>
<?php if ($currency['symbol_left']) { ?>
<a title="<?php echo $currency['title']; ?>"><b><?php echo $currency['symbol_left']; ?></b></a>
<?php } else { ?>
<a title="<?php echo $currency['title']; ?>"><b><?php echo $currency['symbol_right']; ?></b></a>
<?php } ?>
<?php } else { ?>
<?php if ($currency['symbol_left']) { ?>
<a title="<?php echo $currency['title']; ?>" onclick="$('input[name=\'currency_code\']').attr('value', '<?php echo $currency['code']; ?>').submit(); $(this).parent().parent().submit();"><?php echo $currency['symbol_left']; ?></a>
<?php } else { ?>
<a title="<?php echo $currency['title']; ?>" onclick="$('input[name=\'currency_code\']').attr('value', '<?php echo $currency['code']; ?>').submit(); $(this).parent().parent().submit();"><?php echo $currency['symbol_right']; ?></a>
<?php } ?>
<?php } ?>
<?php } ?>
<input type="hidden" name="currency_code" value="" />
<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
</div>
</form>
<?php } ?>
find and delete
Code: Select all
#currency {
width: 75px;
position: absolute;
top: 15px;
left: 425px;
color: #999;
line-height: 17px;
}
Thanks ever so much UKSiteBuilder!!!
Much appreciated! I am sure it works but will report back anyway.
Edit: Just noticed you have a donate button, I will be using it this week if this works!
Many thanks again.
Much appreciated! I am sure it works but will report back anyway.
Edit: Just noticed you have a donate button, I will be using it this week if this works!
Many thanks again.
Skills: Ripp, copy, paste.
Worked like a charm, nice one.
For any other n00bs like myself,
I have a custom template, so I edited the same files on it.
I'm off to buy you a few drinks Simon, thanks again
For any other n00bs like myself,
I have a custom template, so I edited the same files on it.
I'm off to buy you a few drinks Simon, thanks again
Skills: Ripp, copy, paste.
Who is online
Users browsing this forum: No registered users and 75 guests