mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-08-11 15:34:21 -04: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;
|
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()
|
public function industry()
|
||||||
|
@ -425,7 +425,12 @@ iframe.src = '{{ rtrim(SITE_URL ,'/') }}/view/'
|
|||||||
var link = '';
|
var link = '';
|
||||||
|
|
||||||
if (productId) {
|
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 }}' +
|
'?account_key={{ $account->account_key }}' +
|
||||||
'&product_id=' + productId;
|
'&product_id=' + productId;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user