Znalazłem w kodzie tej strony takie zapisy,
tylko pytanie gdzie co umieścić ażeby to funkcjonowało?
Np w kategorii produktów klikając w odpowiednią od razu wyskakiwałoby okno z możliwością zmiksowania
produktów w różnych gramaturach.
<script type="text/javascript">
jQuery(document).ready(function($){
$(".catalog-block .level0.nav-3").mousedown(function(){
showMixer($('#popup').html(),'Malt blander - mix din egen blanding');
return false;
})
reload_totals();
$(".mixer-product input").live("keyup",function(){
reload_totals();
})
})
function reload_totals(){
var total = 0;
var total_weight = 0;
jQuery(".mixer-product input").each(function(){
if (jQuery(this).val()){
var price = parseInt(jQuery(this).parent().prev().find(".price").html());
total += price * jQuery(this).val() / 1000;
total_weight += 1*jQuery(this).val();
}
})
var vm = jQuery(":radio[name=valset_malt]").filter(":checked").val()
total += 18*(vm?vm:0);
total = Math.round(total*Math.pow(10,2))/Math.pow(10,2);
jQuery(".mixer-total-amount").html(total);
total += 10;
total = Math.round(total);
jQuery(".mixer-full-total-amount").html(total);
jQuery(".mixer-total-weight").html(total_weight);
}
function clear_mix(){
jQuery(".mixer-product input").val('');
jQuery(".mixer-total-amount").html('10');
jQuery(".mixer-total-weight").html('0');
return false;
}
function showMixer(msg, title){
jQuery(function($){
$("#mix-popup").dialog('destroy');
$("#mix-popup").html(msg);
reload_totals();
// , closeOnEscape: true
// , show: 'slide'
$('#mix-popup').dialog({title: title,width : 800});
$("#mix-popup").dialog('open');
})
}
</script>
<div id="mix-popup"></div>
<div id="popup" style="display:none;">
<div class="top-text">
<p>Bland din egen færdige malt blanding her. Når du modtaget det eget mix, så ligger det hele samlet i en pose, så du slipper for at have en masse rester af forskellige malt typer</p></div>
<form class="mixer-form" method="post" onsubmit="return false;">
<label class="mix-name">Navn på blanding <input class="required-entry" type="text" value="" name="mix_name" /></label>
<div class="valset-malt">
<label>Valset malt</label>
<div class="mixer-product-price"><span>18 DKK</span></div>
<label><input onclick="reload_totals();" id="valset_malt" class="validate-one-required-by-name radio" type="radio" name="valset_malt" value="1" /><span>Ja</span></label>
<label><input onclick="reload_totals();" class="validate-one-required-by-name radio" type="radio" name="valset_malt" value="0" /><span>Nej</span></label>
</div>
<p style="text-align:left;clear:both;padding-top:5px;"><a href="#" onclick="return clear_mix();">Clear Mix[/url]</p>
<div class="mix-group">
<h3>Basis Malt</h3>
<div class="mixer-product">
<div class="mixer-prod-name"><a target="_blank" href="
http://www.brygladen.com/catalog/product/view/id/260/s/bohemian-pilsner-malt/category/68/" title="">Bohemian Pilsner Malt 1 kg.[/url]</div>
<div class="mixer-product-price product-price-260">
<div class="price-box">
<span class="regular-price" id="product-price-260">
<span class="price">18,00 DKK</span> </span>
</div>
<span class="kg">/kg</span>
</div>
<label style=""><input tabindex="1" type="text" value="" name="mixer[260]" /> gram</label>
<br class="clear" />
</div>