Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions application/Initialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,6 @@ function __autoload($className)
ClassLoader::import('application.model.system.*');
ClassLoader::import('application.LiveCart');

date_default_timezone_set('Europe/Riga');

?>
4 changes: 4 additions & 0 deletions application/LiveCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ public function __construct()
{
error_reporting(E_ALL & ~E_DEPRECATED);
}
elseif(phpversion() >= '5.4')
{
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
}
else
{
error_reporting(E_ALL);
Expand Down
6 changes: 5 additions & 1 deletion application/configuration/language/en/backend/Settings.lng
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,11 @@ SSL_DOMAIN=Use a different domain name for secure pages (e.g. secure.mysite.com)
# Technical
_technical=Technical
_cache=Caching
_queue=Message Queue
CACHE_METHOD=Caching method
QUEUE_METHOD=Queue method
CACHE_TIMEOUT=Cache timeout in seconds
CACHE_PREFIX=Cache prefix (chars and underscores only). Normally blank, but set to 'dev_' in case you have dev machine on the same server (so caches for live and dev won't interfere)
_proxy=Use proxy server for outgoing connections
PROXY_HOST=Proxy server host name
PROXY_PORT=Proxy server port
Expand Down Expand Up @@ -592,4 +596,4 @@ UPDATE_FTP_DIRECTORY=FTP directory

_update_repositories=Module/update repositories
UPDATE_REPO_1=Repository URL
UPDATE_REPO_2=Add new repository
UPDATE_REPO_2=Add new repository
5 changes: 5 additions & 0 deletions application/configuration/registry/12-technical.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

[_cache]
CACHE_METHOD = "<?php substr(ClassLoader::importNow('application.model.cache.ValueCache'), 0, 0) . '/' . implode(', ', ValueCache::getCacheMethods($this->application)) . '/'; ?>"
CACHE_TIMEOUT =
CACHE_PREFIX =

[_queue]
QUEUE_METHOD = "<?php substr(ClassLoader::importNow('application.model.queue.QueueFactory'), 0, 0) . '/' . implode(', ', QueueFactory::getQueueMethods($this->application)) . '/'; ?>"

[_proxy]
PROXY_HOST =
Expand Down
10 changes: 10 additions & 0 deletions application/controller/CheckoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1098,13 +1098,23 @@ public function notify()
}

$order = CustomerOrder::getInstanceById($orderId, CustomerOrder::LOAD_DATA);
$originalCurrency = $order->getCurrency()->getID();//Get the original shopping cart currency
$order->setPaymentMethod(get_class($handler));
$order->loadAll();
$this->order = $order;
$handler->setDetails($this->getTransaction());

$result = $handler->notify($this->request->toArray());

if ($this->order->getCurrency()->getID()!=$originalCurrency)
{
//Update the order currency to match the currency the user made the purchase with
$this->order->changeCurrency(Currency::getInstanceByID($originalCurrency));

//Recalculate all prices, as changing currency does not apply business rules/discounts/etc.
$this->order->getTotal(true);
}

if ($result instanceof TransactionResult)
{
$this->registerPayment($result, $handler);
Expand Down
18 changes: 16 additions & 2 deletions application/controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,14 @@ public function deleteShippingAddress()
{
try
{
return $this->deleteAddress(ShippingAddress::getUserAddress($this->request->get('id'), $this->user));
$res = $this->deleteAddress(ShippingAddress::getUserAddress($this->request->get('id'), $this->user));

$remainingAddresses = $this->user->getShippingAddressSet();
//ARSet->get() returns null if there is no such record index
$this->user->defaultShippingAddress->set($remainingAddresses->get(0));
$this->user->save();

return $res;
}
catch (ARNotFoundException $e)
{
Expand All @@ -800,7 +807,14 @@ public function deleteBillingAddress()
{
try
{
return $this->deleteAddress(BillingAddress::getUserAddress($this->request->get('id'), $this->user));
$res = $this->deleteAddress(BillingAddress::getUserAddress($this->request->get('id'), $this->user));

$remainingAddresses = $this->user->getBillingAddressSet();
//ARSet->get() returns null if there is no such record index
$this->user->defaultBillingAddress->set($remainingAddresses->get(0));
$this->user->save();

return $res;
}
catch (ARNotFoundException $e)
{
Expand Down
2 changes: 2 additions & 0 deletions application/controller/backend/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,9 @@ private function productForm(Product $product)
foreach ($pricesData['calculated'] as $currency => $price)
{
$pricesData['price_' . $currency] = isset($pricesData['defined'][$currency]) ? $pricesData['defined'][$currency] : '';
$pricesData['listPrice_' . $currency] = isset($pricesData['defined'][$currency]) ? $pricesData['listPrice_' . $currency] : '';
$productFormData['price_' . $currency] = $pricesData['price_' . $currency];
$productFormData['listPrice_' . $currency] = $pricesData['listPrice_' . $currency];
}
}

Expand Down
Loading