www.webdeveloper.com
Results 1 to 2 of 2

Thread: Comparison module Virtuemart webshop

Hybrid View

  1. #1
    Join Date
    Apr 2013
    Posts
    2

    Comparison module Virtuemart webshop

    Hi all,

    I've got a problem with a joomla module i'm using for Virtuemart (dutch website).

    At the website www.golfdigital.nl i'm using a comparison module (top left @ page in catalogue). You can select some product (vink 'Vergelijk') and they will appear in the comparison module at the top left. It works perfectly, besides the fact that some products doesn't show in the comparison module when you select them. If you select them and you'll refresh the page, the products will appear. There's a javascript piece that is responsible for adding/removing the products to the module.

    The browser says there's one error (Uncaught TypeError: Cannot call method 'change' of null) in the website. An error in the javascript that's responsible for adding and removing products to the module.

    The javascript code:
    Code:
    $(":checkbox").change(function(){if(this.checked){compareMod(this.id)}else{compareRemove(this.id)}});
    
    function compareMod(id){jQuery.getJSON("index.php",{option: "com_virtuemart",ajax_request:1,view: "cmod",task: "cMod",nosef: "1",product_id: id,format:"json"},function(json){if(json != null)jQuery.each(json, function(key, val) {jQuery("#mod_compareall").prepend("<div id='mod_compare_prod_" + key + "'>"+"<input type='checkbox' id='mod_prod_"+key+"' name='mod_compare_"+key+"' class='compare_checkbox mod_compare_checkbox' CHECKED/>&nbsp;" <?php if($showimage) echo '+ val.im'; ?>+"<a href='" + val.url + "'>" + val.name + "</a>"+"</div>");jQuery("#mod_prod_"+key).live("change",function(){if (this.checked){}else{compareRemove(key);hideItem(key);}});});});};
    
    function compareRemove(a){jQuery.getJSON("index.php",{option:"com_virtuemart",product_id:a,ajax_request:1,task:"cRemove",nosef:"1",format:"json",view:"cremove"},function(b){})};
    
    function hideItem(a){jQuery("#prod_"+a).attr("checked",false);jQuery("#compare_prod_"+a).hide(500);jQuery("#mod_compare_prod_"+a).hide(500).remove()};
    Can somebody help me?

    Thanks in advance!

  2. #2
    Join Date
    Apr 2013
    Posts
    2
    Edit: I've commented out the first line and the error is gone. Script still working the same and shows the same problems. But without error.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles