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-
AuthorPosts
-
July 7, 2017 at 3:07 am #385962
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
July 7, 2017 at 3:08 am #385963This reply has been marked as private.July 7, 2017 at 6:46 am #385970This reply has been marked as private.July 7, 2017 at 10:22 am #385981Hi 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!
July 7, 2017 at 10:47 am #385984Hi 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 scriptIt 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 doIf you need other information don’t hesitate 😉
Thanks
Clem
July 7, 2017 at 6:04 pm #386031Hi,
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
July 8, 2017 at 12:04 am #386079Ok 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
July 13, 2017 at 10:56 am #386863Hi 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
July 13, 2017 at 6:28 pm #386942Hi Clem,
You had a random “.” at the end of your script which was breaking it, i removed it and it now works.
Thanks,
Stiofan
July 16, 2017 at 8:41 am #387211Oh 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
July 17, 2017 at 1:46 pm #387308It 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
July 17, 2017 at 5:44 pm #387368Without 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…
July 17, 2017 at 6:46 pm #387389Try changing this line
jQuery(‘input[name=claimed]’).val(1);
to this:
jQuery(‘input[name=claimed][value=1]’).attr('checked', 'checked');
Stiofan
July 17, 2017 at 7:25 pm #387396Now it works !! 🙂
Thank you very much
Clem
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket