mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge pull request #231 from openclassify/vedat
remove old cookie function && update currency method
This commit is contained in:
commit
e356d42995
@ -2,7 +2,7 @@
|
||||
{% if blocks('ad-item-details-block-area') is null %}
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 offered-field offered-row">
|
||||
<h3 class="ad-price">
|
||||
<b>{{ adv.price.format() }}</b> {{ adv.currency }}
|
||||
<b>{{ currency_symbol(adv.currency) }}{{ adv.price.format() }}</b>
|
||||
|
||||
<!-- priceField with Block -->
|
||||
{{ addBlock('ad-detail/priceField',{'adv':adv})|raw }}
|
||||
|
||||
@ -219,14 +219,9 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
||||
|
||||
public function addCart($item, $quantity = 1)
|
||||
{
|
||||
if (Auth::user()) {
|
||||
$cart = $this->dispatch(new GetCart());
|
||||
$cart->add($item, $quantity);
|
||||
return $this->dispatch(new GetCart());
|
||||
} else {
|
||||
setcookie("cart[" . $item->id . "]", $quantity, time() + 3600, '/', NULL, 0);
|
||||
}
|
||||
|
||||
$cart = $this->dispatch(new GetCart());
|
||||
$cart->add($item, $quantity);
|
||||
return $this->dispatch(new GetCart());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1014,7 +1014,7 @@ class AdvsController extends PublicController
|
||||
$point = ".";
|
||||
|
||||
$response['newPrice'] = number_format($response['newPrice'], $decimals, $point, str_replace(' ', ' ', $separator));
|
||||
$symbol = config('streams::currencies.supported.' . strtoupper(setting_value('streams::currency')) . '.symbol');
|
||||
$symbol = config('streams::currencies.supported.' . strtoupper($adv->currency) . '.symbol');
|
||||
|
||||
$response['newPrice'] = $symbol . $response['newPrice'];
|
||||
$response['status'] = $status;
|
||||
|
||||
@ -103,13 +103,6 @@ class UserAuthenticator
|
||||
if ($response = $this->authenticate($credentials)) {
|
||||
if ($response instanceof UserInterface) {
|
||||
$this->login($response, $remember);
|
||||
if (isset($_COOKIE['cart'])) {
|
||||
foreach ($_COOKIE['cart'] as $adv => $quantity) {
|
||||
$advs = new AdvsController();
|
||||
$advs->advAddCart($adv, $quantity);
|
||||
setcookie("cart[" . $adv . "]", null, -1, '/');
|
||||
}
|
||||
}
|
||||
return Redirect::back();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user