41 lines
1.9 KiB
Smarty
41 lines
1.9 KiB
Smarty
{if $button_product_config != 'disabled'}
|
|
<script type="text/javascript">
|
|
function reformatPrice(price) {
|
|
if (price.length === 0) {
|
|
return false;
|
|
}
|
|
|
|
return parseFloat(price.replace(',', '.').replace(/\s+/g, ''));
|
|
}
|
|
|
|
function PoliczRateCA() {
|
|
let price = '{$cena_raty}';
|
|
let priceObj = jQuery(".current-price");
|
|
if (jQuery('{$caraty_product_selector}').length > 0) {
|
|
priceObj = jQuery('{$caraty_product_selector}');
|
|
}
|
|
if (priceObj.length > 0) {
|
|
price = priceObj.text();
|
|
}
|
|
|
|
price = reformatPrice(price);
|
|
if (price !== false) {
|
|
window.open('https://ewniosek.credit-agricole.pl/eWniosek/simulator.jsp?PARAM_TYPE=RAT&PARAM_PROFILE={$psp}&PARAM_CREDIT_AMOUNT=' + price + '{if isset($caraty_offer_id) && $caraty_offer_id != ''}&offerId={$caraty_offer_id}{/if}', 'Policz_rate', "toolbar=yes,scrollbars=yes,resizable=yes");
|
|
}
|
|
}
|
|
</script>
|
|
{if $button_product_config != 'hidden'}
|
|
<p id="caraty" class="buttons_bottom_block" v="{$version}">
|
|
<a onclick="return PoliczRateCA();"
|
|
style="cursor: pointer;" target="raty_symulator" title="Kupuj na Raty!">
|
|
{if isset($caraty_logo_auto)}
|
|
<img align="middle" alt="" id="caraty_img_auto" style="position: relative; display:block; z-index:10;"
|
|
src="{$caraty_logo_auto.url}?creditAmount={$cena_raty}&posId={$psp}&imgType={$caraty_logo_auto.type}{if isset($caraty_offer_id)}{if $caraty_offer_id != ''}&offerId={$caraty_offer_id}{/if}{/if}">
|
|
{else}
|
|
<img align="middle" alt="" src="{$caraty_logo_calc}" style="position: relative; display:block; z-index:10;">
|
|
{/if}
|
|
</a>
|
|
</p>
|
|
{/if}
|
|
{/if}
|