Nápověda k e-shop řešení ShopSystem.
Efektivní e-shop systém pro internetové obchodování bez kompromisů.

SmartForm - nastavení

https://www.smartform.cz/

https://www.smartform.cz/pro-web/postup-shopsystem.php

Admin -> Nastavení -> Úprava CSS / JS

Externí JS soubory (HTML kód):

<script type="text/javascript" src="https://secure.smartform.cz/api/v1/smartform.js" async></script>

JavaScript

$(document).ready(function(){
$("#inv_street,#inv_house_no,#inv_town,#inv_zip,#del_street,#del_house_no,#del_town,#del_zip").attr("autocomplete", "off");
});

var smartform = smartform || {};
smartform.beforeInit = function () {
	smartform.setClientId('_clientId_');
}

smartform.afterInit = function () {
	if ($("#inv_street").length) {
		$("#inv_street").addClass("smartform-street smartform-instance-1");
		$("#inv_house_no").addClass("smartform-number smartform-instance-1");
		$("#inv_town").addClass("smartform-city smartform-instance-1");
		$("#inv_zip").addClass("smartform-zip smartform-instance-1");
	}

	if ($("#del_street").length) {
		$("#del_street").addClass("smartform-street smartform-instance-2");
		$("#del_house_no").addClass("smartform-number smartform-instance-2");
		$("#del_town").addClass("smartform-city smartform-instance-2");
		$("#del_zip").addClass("smartform-zip smartform-instance-2");
	}

	smartform.rebindAllForms(true, function () {
		$("#inv_id_country").change(smartformSetCountry);
		$("#del_id_country").change(smartformSetCountry);
		smartformSetCountry();
	});
}

function smartformSetCountry() {
	if (smartform.getInstance("smartform-instance-1")){
		var inv_id_country = $("#inv_id_country option:selected").attr("data-code");
		
		if (inv_id_country=='CZ' || inv_id_country=='SK'){
			smartform.getInstance("smartform-instance-1").setCountry(inv_id_country);
			smartform.getInstance("smartform-instance-1").setAllOraclesEnabled(true);
		}
		else
			smartform.getInstance("smartform-instance-1").setAllOraclesEnabled(false);
	}
	if (smartform.getInstance("smartform-instance-2")){
		var del_id_country = $("#del_id_country option:selected").attr("data-code");
		
		if (del_id_country=='CZ' || del_id_country=='SK'){
			smartform.getInstance("smartform-instance-2").setCountry(del_id_country);
			smartform.getInstance("smartform-instance-2").setAllOraclesEnabled(true);
		}
		else
			smartform.getInstance("smartform-instance-2").setAllOraclesEnabled(false);
	}
}