Automatic category selection not working anymore

This topic contains 13 replies, has 4 voices, and was last updated by  clem 7 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #385962

    clem
    Buyer
    Post count: 87

    Hi Geodirectory team,

    I have a Java script piece of code on my site who was working perfectly since a long time. (I found it on this forum) now it doesn’t work anymore and I don’t understand what’s wrong

    I have only one category par package so this fonction make and automatic selection in the add listing form

    I spent 2 hours trying to solve it but no success

    It could be since I installed the last Geodirectory update but not sure

    The fonction is in the GD Footer script code (I have another fonction “automatic selection of Listing claim”) who doesn’t work anymore to at the same place)

    I try to uninstall all the other plugins but still the problem…

    Thanks

    Clem

    #385963

    clem
    Buyer
    Post count: 87
    This reply has been marked as private.
    #385970

    clem
    Buyer
    Post count: 87
    This reply has been marked as private.
    #385981

    Kor
    Moderator
    Post count: 16516

    Hi Clem,

    Could you tell us a little bit more about what’s not working on your end? I’ve checked your Website and everything seems to work fine.

    Thanks!

    #385984

    clem
    Buyer
    Post count: 87

    Hi Kor

    To see the problem, you first have to go in kitesurfing place setting > category > set ajax chain unsted of checkbox

    Then, if you create a new place (spot) the category and default category should fill automatically (I hide it by css so the user doesn’t have to take care of the category)
    This is a piece of java script who make it possible in design > script > footer script

    It was working perfectly during months and since a few days it doesn’t. I haven’t done many changes these last few weeks so I can’t find out what happen…
    I think it corresponds at the moment I did the update of geodirectory but maybe nothing to do

    If you need other information don’t hesitate 😉

    Thanks

    Clem

    #386031

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    there must be a JS conflict, but I don’t see any error in the console so I don’t even know where to start.

    I asked to Stiofan to have a look, however he’s off for a couple of days now and he’ll back after the week end. (It is possible that he’ll work few hours on Sunday, but I can’t promise it).

    He’ll let you know asap.

    Thanks

    #386079

    clem
    Buyer
    Post count: 87

    Ok no worries, people can still add listing by filling the category manually so it can wait next week 🙂

    Have a great weekend guys

    Thanks

    Clem

    #386863

    clem
    Buyer
    Post count: 87

    Hi Stiofan,

    Did you have a look to this problem ?

    I was wondering, I shouldn’t be the only Geodirectory user having only 1 category per price package and annoyed that our users have to select this category in the add listing form…

    It shouldn’t be to hard to make a setting with checkbox (because actually we don’t need to select the default category if there is only one) that the category is already selected and then we just have to hide it with css

    it would be more reliable than the JS fonction…

    Thanks

    Clem

    #386942

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Clem,

    You had a random “.” at the end of your script which was breaking it, i removed it and it now works.

    Thanks,

    Stiofan

    #387211

    clem
    Buyer
    Post count: 87

    Oh sorry for that, I checked the code 10 times but haven’t seen it 🙁

    Works fine now for the categories but still have an issue with the second JS fonction (was working properly before):

    jQuery(function() {
    if(jQuery(‘input[name=package_id]’).length){

    var package_id = jQuery(‘input[name=package_id]:checked’).val();
    _my_gd_package_set_claim(package_id);

    }

    });

    function _my_gd_package_set_claim(pkg){
    if(pkg==4 || pkg==8){
    jQuery(‘input[name=claimed]’).val(1);
    jQuery(‘#geodir_claimed_row’).hide();
    }else{
    jQuery(‘#geodir_claimed_row’).show();
    }

    }

    If a listing – package 4 or 8 – is added the claimed radio “yes” should be checked. the fonction works because it hides – #geodir_claimed_row – and the field is not required anymore but “yes” button haven’t been selected.

    (Is Claimed: No on the backend listing and can’t see the author name on the frontend listing)

    I spent the afternoon trying to solve it by myself but as I know nothing about JS, didn’t find out the problem.

    Can you help again ?

    So sorry, for all these questions, I know and understand this work can’t be included in your support so I can paye for the time you spend on it. Just tell me how much and how I can paye…

    Thanks

    Clem

    #387308

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    It looks like you have modified the claim inputs, the both have the value of 1 instead of 1 and 0 so the JS is not working.

    Stiofan

    #387368

    clem
    Buyer
    Post count: 87

    Without the JS the value is 1 and 0 (eg package 17) The JS modify both claim imputs because they have the same name : jQuery(‘input[name=claimed]’).val(1)

    I just tried on another website and same result

    Actually I think it has never worked properly, I thought it was working because #geodir_claimed_row was hidden and the field wasn’t required anymore. but I have never seen that the “yes” wasn’t selected…

    #387389

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Try changing this line

    jQuery(‘input[name=claimed]’).val(1);

    to this:

    jQuery(‘input[name=claimed][value=1]’).attr('checked', 'checked');

    Stiofan

    #387396

    clem
    Buyer
    Post count: 87

    Now it works !! 🙂

    Thank you very much

    Clem

Viewing 14 posts - 1 through 14 (of 14 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount