1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Fix buy button when using custom domain #1633

This commit is contained in:
Hillel Coren 2017-08-22 21:19:42 +03:00
parent 65bf31c911
commit aefed1f11e
2 changed files with 15 additions and 3 deletions

View File

@ -63,9 +63,16 @@ class AccountPresenter extends Presenter
return $currency->code;
}
public function clientPortalLink()
public function clientPortalLink($subdomain = false)
{
return Domain::getLinkFromId($this->entity->domain_id);
$account = $this->entity;
$url = Domain::getLinkFromId($account->domain_id);
if ($subdomain && $account->subdomain) {
$url = Utils::replaceSubdomain($url, $account->subdomain);
}
return $url;
}
public function industry()

View File

@ -425,7 +425,12 @@ iframe.src = '{{ rtrim(SITE_URL ,'/') }}/view/'
var link = '';
if (productId) {
var link = '{{ url('/buy_now') }}' + paymentType +
@if (Utils::isNinjaProd())
var domain = '{{ $account->present()->clientPortalLink(true) }}';
@else
var domain = '{{ url('/buy_now') }}';
@endif
var link = domain + paymentType +
'?account_key={{ $account->account_key }}' +
'&product_id=' + productId;