I'm trying to create a custom payment module, and I need to be able to pull the order_id and total from the current session. What's the correct syntax for this? I've been able to get order_id, but not total. I've been pulling out what little hair I have left. Can anyone give me some direction?
Beautiful. OK, so I've generated a URL that shows up on the "order confirmation" page:
"https://external.payment.com/etc.php?Reference=" . $this->session->data['order_id'] . "&Amount=" . $this->cart->getSubTotal()
Is there any trick to making this same URL appear on the "success" page?
"https://external.payment.com/etc.php?Reference=" . $this->session->data['order_id'] . "&Amount=" . $this->cart->getSubTotal()
Is there any trick to making this same URL appear on the "success" page?
Still having trouble getting the complete, final, master, everything-included-here, TOTAL for the order. Currently, I'm using
round(($this->cart->getSubTotal() + array_sum($this->cart->getTaxes())),2)
But this leaves out shipping, handling fees and other stuff. What variable stores the grand total?
round(($this->cart->getSubTotal() + array_sum($this->cart->getTaxes())),2)
But this leaves out shipping, handling fees and other stuff. What variable stores the grand total?
Grand total in 1.4.7 is calculated on the confirm page
The code you can reuse in your payment module is:
The after that you can check it:
The code you can reuse in your payment module is:
Code: Select all
$total = 0;
$taxes = $this->cart->getTaxes();
$this->load->model('checkout/extension');
$sort_order = array();
$results = $this->model_checkout_extension->getExtensions('total');
foreach ($results as $key => $value) {
$sort_order[$key] = $this->config->get($value['key'] . '_sort_order');
}
array_multisort($sort_order, SORT_ASC, $results);
foreach ($results as $result) {
$this->load->model('total/' . $result['key']);
$this->{'model_total_' . $result['key']}->getTotal($total_data, $total, $taxes);
}
Code: Select all
if ($total) {
echo 'yes';
}
Ok, got this from confirm.php in 1.5.1.3. Slightly different :
Code: Select all
$total = 0;
$taxes = $this->cart->getTaxes();
$this->load->model('setting/extension');
$sort_order = array();
$results = $this->model_setting_extension->getExtensions('total');
foreach ($results as $key => $value) {
$sort_order[$key] = $this->config->get($value['code'] . '_sort_order');
}
array_multisort($sort_order, SORT_ASC, $results);
foreach ($results as $result) {
if ($this->config->get($result['code'] . '_status')) {
$this->load->model('total/' . $result['code']);
$this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes);
}
}
something bad with this code? Where i should paste this code?

Code: Select all
$total = 0;
$taxes = $this->cart->getTaxes();
$this->load->model('checkout/extension');
$sort_order = array();
$results = $this->model_checkout_extension->getExtensions('total');
foreach ($results as $key => $value) {
$sort_order[$key] = $this->config->get($value['key'] . '_sort_order');
}
array_multisort($sort_order, SORT_ASC, $results);
foreach ($results as $result) {
$this->load->model('total/' . $result['key']);
$this->{'model_total_' . $result['key']}->getTotal($total_data, $total, $taxes);
}
Who is online
Users browsing this forum: No registered users and 20 guests