castria
Forum Replies Created
-
That works perfectly now. Thanks so much for your efforts! I’ll send a review and a donation your way by today/tomorrow.
Yes, I used a semicolon. I’ve double checked the file you mentioned and it shows exactly as you wrote.
Here is a gallery showing my configs and how the product page shows when nothing is checked vs when something is checked.
Ah that makes sense. So functionally that is working now. The only issue i’m still seeing is that if nothing is selected in the multicheckbox, i get the error message
“Total Variable “aps” is not valid around position 13 for expression
is_selected(aps, 1).”As soon as at least one is checked the error message goes away and it works as intended.
Ok, I installed the github version.
The add-on price calculation is as follows ({aps} is multi checkbox, ap1 is the number field that appears when the first checkbox is checked):
if is_selected(1,{aps}) add {ap1} * 100I get the following error message on the product page:
“Total Arguments must be separated by a comma. Unexpected token “punctuation” of value “.” (“punctuation” expected with value “,”) around position 14 for expression
is_selected(1.aps).”- This reply was modified 3 years, 10 months ago by castria.
My idea was to make function something like is_selected({multicb}, 1), maybe you have better idea?
Yeah this is my thinking for what should be the simplest solution.
Thank you so much. Incredible support for a free plugin. That works great now.
I’ve now encountered a new problem. In price calculation, I chose “Price Add-ons”. I want it to be:
if {multi_cb} == 1, add {number_field_1} * 100 if {multi_cb} == 2, add {number_field_2} * 185 if {multi_cb} == 3, add {number_field_3} * 220but doing this doesn’t work and i get the following message on the product screen:
“Total Variable “multi_cb” is not valid around position 1 for expression “multi_cb == 1”. Did you mean “number_field_1″?”
It does work if my conditional checks if the number fields are >= 1 but the problem there is they have a minimum value of 1, so if the checkbox is selected, it would add the price, but if it was then deselected, it becomes invisible but the price doesn’t go back to 0, so it only works properly if the price is only set to be added IF the relevant checkbox is checked in the multi checkbox.
@wckalkulator Works perfectly, thank you!
I did notice another bug you may want to be aware of. I also had tried with multi-checkboxes. I wanted to have, for example, 5 checkboxes and a number field that becames visible for each checkbox. So, if checkbox 1, 3 and 4 were checked, number fields 1, 3 and 4 would become visible. This didn’t work for me using manual values, “is empty” or “has any value”. If you can get this working it’d be a big help for a client i currently have and I know you don’t do a paid version but i’ll hapilly give a donation if you give me a few days.
I tried using the em_maps_locations_hook in a separate file but i get an error.
jQuery(document).bind('em_maps_locations_hook', function( e, map, infowindow, marker ) { google.maps.event.addListener(marker, 'click', function(event) { console.log('success'); }); });“Uncaught TypeError: a is undefined”
I tried using the em_maps_locations_hook in a separate file but i get an error.
jQuery(document).bind('em_maps_locations_hook', function( e, map, infowindow, marker ) { google.maps.event.addListenerOnce(marker, 'click', function(event) { console.log('success'); }); });“Uncaught TypeError: a is undefined”
It seems that it was actually a different plugin which was causing this problem (WP Google Maps). Image sliders and testimonial sliders were also broken as well as lazy loading until i deactivated the WP Google Maps plugin. It seems to be a JQuery error in their latest update. I’ve mesaged the developer about it.
- This reply was modified 7 years, 6 months ago by castria.