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:
parent
65bf31c911
commit
aefed1f11e
@ -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()
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user