Jump to content

totallytech

Members
  • Posts

    42
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

totallytech's Achievements

Member

Member (2/5)

0

Reputation

  1. I actually think this may be JS. I found this: // On new category form submit. $('#new-category-form').on('submit', function(event) { var data = $(this).serialize(); $.post(ajaxurl, data, function(response) { $('.ab-category-item-list').append(response); $('#new_category_popup').ab_popup('close'); // add created category to services $.each($('#services_list').find('select[name="category_id"]'), function(key, value) { var $new_category = $('.ab-category-item:last'); $(value).append('<option value="' + $new_category.data('id') + '">' + $new_category.find('input').val() + ' </option>'); }); }); return false; }); but thats for creating a new category in the admin section of the plugin - I can't find where it actually places the data for use when displaying on the page...
  2. Its a custom theme that I've designed using artisteer, I've used dreamweaver to check for select, option, ab - just all kinds, I've been searching for around 5 hours using dreamweaver and I've checked the database - I'm now checking the posts table etc to see if anything comes up
  3. Hey, I'm not sure if this is a php, JS or wordpress issue. This is my site - its the booking area I'm attempting to edit.... http://goo.gl/cGHA8Y For example, if I add class="ab-formElement ab-select-mobile ab-select-service" to any code (<select><input> even a <div>) then it adds the <option.....> to it - So I created a <div> and the output is: <div class="ab-formElement ab-select-mobile ab-select-service" value="Select service"> <option value="1">Class IV (4) MOT</option> <option value="2">Class VII (7) MOT</option> <option value="3">Engine Service</option> <option value="4">Full Engine Service</option> <option value="5">Aircon Leak Test, Re-Gas & Service</option> <option value="6">Aircon Re-Gas & Service</option> <option value="7">FREE Safety Check</option> <option value="8">Engine Diagnostic Check</option> </div> however if I view the source of the page it shows: <!-- Plugin Name: Bookly – Responsive WordPress Appointment Booking and Scheduling Plugin Plugin URI: http://booking-wp-plugin.com Version: 7.0.1 --> <style type="text/css"> /* Service */ .ab-label-error {color: #5b3222!important;} label.ab-category-title {color: #5b3222!important;} .ab-next-step, .ab-mobile-next-step, .ab-mobile-prev-step, li.ab-step-tabs.active div, .picker__frame, .ab-first-step .ab-week-days li label {background: #5b3222!important;} li.ab-step-tabs.active a {color: #5b3222!important;} div.ab-error select {border: 2px solid #5b3222!important;} .picker__header {border-bottom: 1px solid #5b3222!important;} .picker__nav--next, .pickadate__nav--prev {color: #5b3222!important;} .picker__nav--next:before {border-left: 6px solid #5b3222!important;} .picker__nav--prev:before {border-right: 6px solid #5b3222!important;} .picker__day:hover {color: #5b3222!important;} .picker__day--selected:hover {color: #5b3222!important;} .picker--focused .picker__day--selected {color: #5b3222!important;} .picker--focused .picker__day--highlighted {color: #5b3222!important;} .picker__button--clear {color: #5b3222!important;} .picker__button--today {color: #5b3222!important;} .ab-first-step .ab-week-days li label.active {background: #5b3222 url(http://kerrymotorservices.co.uk/wp-content/plugins/appointment-booking/frontend/resources/images/checkbox.png) 0 0 no-repeat!important;} /* Time */ .ab-columnizer .ab-available-day { background: #5b3222!important; border: 1px solid #5b3222!important; } .ab-columnizer .ab-available-hour:hover { border: 2px solid #5b3222!important; color: #5b3222!important; } .ab-columnizer .ab-available-hour:hover .ab-hour-icon { background: none; border: 2px solid #5b3222!important; color: #5b3222!important; } .ab-columnizer .ab-available-hour:hover .ab-hour-icon span {background: #5b3222!important;} .ab-time-next {background: #5b3222!important;} .ab-time-prev {background: #5b3222!important;} .ab-to-first-step {background: #5b3222!important;} /* Details */ label.ab-formLabel {color: #5b3222!important;} a.ab-to-second-step {background: #5b3222!important;} a.ab-to-fourth-step {background: #5b3222!important;} div.ab-error {color: #5b3222!important;} input.ab-details-error, textarea.ab-details-error {border: 2px solid #5b3222!important;} .ab-to-second-step, .ab-to-fourth-step {background: #5b3222!important;} /* Payment */ .btn-apply-coupon {background: #5b3222!important;} .ab-to-third-step {background: #5b3222!important;} .ab-final-step {background: #5b3222!important;} </style><div id="ab-booking-form-5616996946098" class="ab-booking-form"> <div style="text-align: center"><img src="http://kerrymotorservices.co.uk/wp-includes/js/tinymce/skins/lightgray/img/loader.gif" alt="Loading..." /></div> </div> <script type="text/javascript"> (function (win, fn) { var done = false, top = true, doc = win.document, root = doc.documentElement, modern = doc.addEventListener, add = modern ? 'addEventListener' : 'attachEvent', rem = modern ? 'removeEventListener' : 'detachEvent', pre = modern ? '' : 'on', init = function(e) { if (e.type == 'readystatechange') if (doc.readyState != 'complete') return; (e.type == 'load' ? win : doc)[rem](pre + e.type, init, false); if (!done) { done = true; fn.call(win, e.type || e); } }, poll = function() { try { root.doScroll('left'); } catch(e) { setTimeout(poll, 50); return; } init('poll'); }; if (doc.readyState == 'complete') fn.call(win, 'lazy'); else { if (!modern) if (root.doScroll) { try { top = !win.frameElement; } catch(e) { } if (top) poll(); } doc[add](pre + 'DOMContentLoaded', init, false); doc[add](pre + 'readystatechange', init, false); win[add](pre + 'load', init, false); } })(window, function() { window.bookly({ is_finished : 0, is_cancelled : 0, ajaxurl : "http:\/\/kerrymotorservices.co.uk\/wp-admin\/admin-ajax.php", attributes : {"hide_categories":"1","category_id":"1","hide_services":false,"service_id":false,"hide_staff_members":"1","staff_member_id":false,"hide_date_and_time":"1","show_number_of_persons":false}, form_id : "5616996946098", start_of_week : 1, date_min : 0, final_step_url : "", custom_fields : [{"type":"text-field","label":"Vehicle Registration","required":true,"id":73007},{"type":"text-field","label":"Vehicle Make / Model","required":true,"id":1973},{"type":"textarea","label":"Notes or details of any current issues with the vehicle","required":false,"id":1}], day_one_column : 1, show_calendar : 0, woocommerce : 0, woocommerce_cart_url : "" }); }); </script></p> </div> I've checked the database to make sure it doesnt specify <option> etc but it doesn't and I've done all sorts of searches via dreamweaver in the code directly to see if I can work out where it adds it but nothing so far... Any ideas?
  4. Hi There, I currently have a piece of code which pulls information from a db via get_option <select class="ab-formElement ab-select-mobile ab-select-service"> <option value=""><?php echo esc_html( __( get_option( 'ab_appearance_text_option_service' ), 'ab' ) ) ?></option> </select> The code above displays all 8 options in my database. but I need to change the way they display to radio buttons. I've tried: <input type="radio" name="services" value="'<?php echo esc_html( __( get_option( 'ab_appearance_text_option_service' ), 'ab' ) ) ?>'" /> which just displays the first option, I cannot see how the first set of code finds 8 outputs but the radio code only finds one.. Can anyone help me out please?
  5. Thank you. I used to code in php about 6 years ago but admittedly basic php - I'm now retraining but I'm just editing someone elses code at the moment and I've got really lazy and even the really obvious stuff looks hard now... . Thanks for the help
  6. Hey, I've have a tiny little piece of code, which currently looks like: <?php printf( '<span class="cart-link"><a href="%1$s" title="%2$s">%3$s</a></span>', esc_url( $ImStore->get_permalink( "shopping-cart", true, false, $post->post_parent ) ), esc_attr__( 'Link to shopping cart', 'ims' ), __( 'Cart', 'ims' ) ?> which generates an href with the url to the shopping cart in. How would I strip out the url - so I just end up with echo "http://mystore.com/cart"; and nothing around it?
  7. If I'd coded this all myself, it would all be in different files, however because this is a wordpress plugin that I'm manually changing its a nightmare and I'm just making sense of the existing code. I've managed to swap the drop down images to radios, hidden the radio and added labels which are the images, so thats all working but I just cannot get it to submit onclick
  8. I've had a little edit as I found some code that creates a click function on each img with a class thumbnail, so I've added the class to the images. This is the code $script .="$(document).ready(function() {"; $script .="$('img.thumbnail').click(function() {"; $script .="window.location.href='".$href."'.replace(/__selected_service__/, selected_service);"; $script .="});"; $script .="});"; $s .= '<input type="radio" name="app_select_services" id="'.$service->ID.'" value="'.$service->ID.'"'.$sel.' /><label for="'.$service->ID.'"><img class="thumbnail" src="http://kerrymotorservices.co.uk/wp-content/uploads/2015/04/'.$service->ID.'.png" title="'.$service_description.'"></label>'; However it still doesnt work. Any ideas what I've missed?
  9. Any ideas why the location isnt working onclick? I'm not sure if I've included enough code - this is the whole function: public function process_shortcode ($args=array(), $content='') { extract(wp_parse_args($args, $this->_defaults_to_args())); global $wpdb, $appointments; $appointments->get_lsw(); if ( !trim( $order_by ) ) $order_by = 'ID'; if ( $worker ) { $services = $appointments->get_services_by_worker( $worker ); // Find first service by this worker $fsby = $services[0]->ID; if ( $fsby && !@$_REQUEST['app_service_id'] ) { $_REQUEST['app_service_id'] = $fsby; // Set this as first service $appointments->get_lsw(); // Update } // Re-sort worker services if (!empty($services) && !empty($order_by) && 'ID' !== $order_by) $services = $this->_reorder_services($services, $order_by); } else $services = $appointments->get_services( $order_by ); $services = apply_filters( 'app_services', $services ); // If there are no workers do nothing if ( !$services || empty( $services ) ) return; $script =''; $s = ''; $e = ''; $s .= '<div class="app_services">'; $s .= '<div class="app_services_dropdown">'; $s .= '<div class="app_services_dropdown_title">'; $s .= $select; $s .= '</div>'; $s .= '<div class="app_services_dropdown_select">'; if ( $services ) { foreach ( $services as $service ) { $service_description = ''; // Check if this is the first service, so it would be displayed by default if ( $service->ID == $appointments->service ) { $d = ''; $sel = ' checked="checked"'; } else { $d = ' style="display:none"'; $sel = ''; } // Add options $s .= '<input type="radio" name="app_select_services" id="'.$service->ID.'" value="'.$service->ID.'"'.$sel.' /><label for="'.$service->ID.'"><img src="http://mysite.co.uk/'.$service->ID.'.png" style="border:0;margin:0;"></label>'; // Include excerpts $e .= '<div '.$d.' class="app_service_excerpt" id="app_service_excerpt_'.$service->ID.'" >'; // Let addons modify service page $page = apply_filters( 'app_service_page', $service->page, $service->ID ); switch ( $description ) { case 'none' : break; case 'excerpt' : $service_description .= $appointments->get_excerpt( $page, $thumb_size, $thumb_class, $service->ID ); break; case 'content' : $service_description .= $appointments->get_content( $page, $thumb_size, $thumb_class, $service->ID ); break; default : $service_description .= $appointments->get_excerpt( $page, $thumb_size, $thumb_class, $service->ID ); break; } $e .= apply_filters('app-services-service_description', $service_description, $service, $description) . '</div>'; } } $s .= '<input type="button" class="app_services_button" value="'.$show.'">'; $s .= '</div>'; $s .= '</div>'; $s .= '<div class="app_service_excerpts">'; $s .= $e; $s .= '</div>'; $s .= '</div>'; if ( isset( $_GET['wcalendar'] ) && (int)$_GET['wcalendar'] ) $wcalendar = (int)$_GET['wcalendar']; else $wcalendar = false; // First remove these parameters and add them again to make wcalendar appear before js variable $href = add_query_arg( array( "wcalendar"=>false, "app_provider_id" => false, "app_service_id" => false ) ); $href = apply_filters( 'app_service_href', add_query_arg( array( "wcalendar"=>$wcalendar, "app_service_id" => "__selected_service__" ), $href ) ); if ( $autorefresh ) { $script .= "$('.app_services_button').hide();"; } $script .= "$('.app_select_services').change(function(){"; $script .= "var selected_service=$('input[type=radio][name=app_select_services]:checked').val();"; $script .= "if (typeof selected_service=='undefined' || selected_service===null){"; $script .= "selected_service=".$appointments->get_first_service_id().";"; $script .= "}"; $script .= "$('.app_service_excerpt').hide();"; $script .= "$('#app_service_excerpt_'+selected_service).show();"; if ( $autorefresh ) { $script .= "window.location.href='".$href."'.replace(/__selected_service__/, selected_service);"; } $script .= "});"; $script .= "$('.app_services_button').click(function(){"; $script .= "var selected_service=$('input[type=radio][name=app_select_services]:checked').val();"; $script .= "window.location.href='".$href."'.replace(/__selected_service__/, selected_service);"; $script .= "});"; if (!$_noscript) $appointments->add2footer( $script ); return $s; }
  10. Hey All, I need to change the way some of my radio buttons display. I've set up a demo here which should show you what I'm trying to do, however I cannot work out how to merge the codes.... $s .= '<div class="app_services_dropdown_select">'; //$s .= '<select name="app_select_services" class="app_select_services">'; if ( $services ) { foreach ( $services as $service ) { $service_description = ''; // Check if this is the first service, so it would be displayed by default if ( $service->ID == $appointments->service ) { $d = ''; $sel = ' checked="checked"'; } else { $d = ' style="display:none"'; $sel = ''; } // Add options //$s .= '<option value="'.$service->ID.'"'.$sel.'>'. stripslashes( $service->name ) . '</option>'; $s .= '<input type="radio" name="app_select_services" value="'.$service->ID.'"'.$sel.' />'. stripslashes( $service->name ).'<br />'; // Include excerpts $e .= '<div '.$d.' class="app_service_excerpt" id="app_service_excerpt_'.$service->ID.'" >'; // Let addons modify service page $page = apply_filters( 'app_service_page', $service->page, $service->ID ); switch ( $description ) { case 'none' : break; case 'excerpt' : $service_description .= $appointments->get_excerpt( $page, $thumb_size, $thumb_class, $service->ID ); break; case 'content' : $service_description .= $appointments->get_content( $page, $thumb_size, $thumb_class, $service->ID ); break; default : $service_description .= $appointments->get_excerpt( $page, $thumb_size, $thumb_class, $service->ID ); break; } $e .= apply_filters('app-services-service_description', $service_description, $service, $description) . '</div>'; } } //$s .= '</select>'; $s .= '<input type="button" class="app_services_button" value="'.$show.'">'; $s .= '</div>'; Obviously the actual display code for the radio buttons is: $s .= '<input type="radio" name="app_select_services" value="'.$service->ID.'"'.$sel.' />'. stripslashes( $service->name ).'<br />'; and the display code is: <img class="hidden" id="car" src="http://site.co.uk/wp-content/uploads/2015/04/car.png" /> <img class="hidden" id="van" src="http://site.co.uk/wp-content/uploads/2015/04/van.png" /> <div id="imageSelectList"></div> The car is value 1 on the radio and the van is 2... The JS for the above is function createImageSelectList(id, name, arrOptions) { var $elm = $("#" + id); for(var x = 0; x<arrOptions.length; x++) { var opt = arrOptions[x]; var subId = name + "_" + opt.value; var $rad = $("<input />"); $rad.attr("type", "radio"); $rad.attr("value", opt.value); $rad.attr("name", name); $rad.attr("id", subId); var $lbl = $("<label />"); $lbl.attr("for", subId); $lbl.append($("<img />") .attr("src", $("#" + opt.image).attr("src"))); $elm.append($lbl); $elm.append($rad); $rad.change(function(){ alert('radio ' +this.value +' was checked') }) } } createImageSelectList("imageSelectList", "pickImage1", [ {value: 1, image: "car"}, {value: 2, image: "van"} ]); How can I merge the two?
  11. Hey, I've got some code, which if autorefresh=1 then the submit button disappears and the page should change. The button does indeed disappear, however the page no longer changes and I cannot see what I'm missing... if ( $autorefresh ) { $script .= "$('.app_services_button').hide();"; } $script .= "$('.app_select_services').change(function(){"; $script .= "var selected_service=$('input[type=radio][name=app_select_services]:checked').val();"; $script .= "if (typeof selected_service=='undefined' || selected_service===null){"; $script .= "selected_service=".$appointments->get_first_service_id().";"; $script .= "}"; $script .= "$('.app_service_excerpt').hide();"; $script .= "$('#app_service_excerpt_'+selected_service).show();"; if ( $autorefresh ) { $script .= "window.location.href='".$href."'.replace(/__selected_service__/, selected_service);"; } $script .= "});"; $script .= "$('.app_services_button').click(function(){"; $script .= "var selected_service=$('input[type=radio][name=app_select_services]:checked').val();"; $script .= "window.location.href='".$href."'.replace(/__selected_service__/, selected_service);"; $script .= "});"; There is also this code: $(function () { $(document) .on("click", ".app_services_button, .app_workers_button", handle_submission) .on("click", ".appointments-list table td.free, .app_timetable div.free", handle_scheduling) .on("click", ".app_monthly_schedule_wrapper table td.free", handle_day_switch) .on("change", ".app_select_services", load_service_description) .on("change", ".app_select_workers", load_worker_biography) ; }); Can anyone see what I've missed?
  12. another section that calls the button is: $(function () { $(document) .on("click", ".app_services_button, .app_workers_button", handle_submission) .on("click", ".appointments-list table td.free, .app_timetable div.free", handle_scheduling) .on("click", ".app_monthly_schedule_wrapper table td.free", handle_day_switch) .on("change", ".app_select_services", load_service_description) .on("change", ".app_select_workers", load_worker_biography) ; }); but again, I cannot see anything to edit here
  13. If I use $script .= "var selected_service=$('input[type='radio'][name='app_select_services']:checked').val();"; then if I access the url directly setting ?app_service_id=1 then the first radio button works, and setting ?app_service_id=2 then the second radio button also works but the submit button no longer works to change the value -EDIT $script .= "var selected_service=$('input[type=radio][name=app_select_services]:checked').val();"; I've now got it working if I click on the button using the code above (too many ') however if I send autorefresh=1 in the shortcode it should hide the button (which it does) and submit onclick (which it doesnt...) if ( $autorefresh ) { $script .= "$('.app_services_button').hide();"; } $script .= "$('.app_select_services').change(function(){"; $script .= "var selected_service=$('input[type=radio][name=app_select_services]:checked').val();"; $script .= "if (typeof selected_service=='undefined' || selected_service===null){"; $script .= "selected_service=".$appointments->get_first_service_id().";"; $script .= "}"; $script .= "$('.app_service_excerpt').hide();"; $script .= "$('#app_service_excerpt_'+selected_service).show();"; if ( $autorefresh ) { $script .= "window.location.href='".$href."'.replace(/__selected_service__/, selected_service);"; } $script .= "});"; $script .= "$('.app_services_button').click(function(){"; $script .= "var selected_service=$('input[type=radio][name=app_select_services]:checked').val();"; $script .= "window.location.href='".$href."'.replace(/__selected_service__/, selected_service);"; $script .= "});"; any ideas why its not submitting itself?
  14. I'm assuming that $script .= "var selected_service=$('.app_select_services option:selected').val();"; is the code that I'm looking at, obviously its a radio not an option and its checked not selected so I tried $script .= "var selected_service=$('.app_select_services radio:checked').val();"; but still nothing. I've even tried $script .= "var selected_service=$('input[type='radio'][name='app_select_services']:checked').val();";
  15. Yes!! Thank you!! Now you've said that I've just located: $script .= "$('.app_services_button').click(function(){"; $script .= "var selected_service=$('.app_select_services option:selected').val();"; $script .= "window.location.href='".$href."'.replace(/__selected_service__/, selected_service);"; $script .= "});"; I've tried: $script .= "$('.app_select_services').change(function(){"; $script .= "var selected_service=$('.app_select_services radio:selected').val();"; $script .= "if (typeof selected_service=='undefined' || selected_service===null){"; $script .= "selected_service=".$appointments->get_first_service_id().";"; $script .= "}"; $script .= "$('.app_service_excerpt').hide();"; $script .= "$('#app_service_excerpt_'+selected_service).show();"; if ( $autorefresh ) { $script .= "window.location.href='".$href."'.replace(/__selected_service__/, selected_service);"; } $script .= "});"; $script .= "$('.app_services_button').click(function(){"; $script .= "var selected_service=$('.app_select_services radio:selected').val();"; $script .= "window.location.href='".$href."'.replace(/__selected_service__/, selected_service);"; $script .= "});"; And I've tried $script .= "$('.app_select_services').change(function(){"; $script .= "var selected_service=$('.app_select_services radio:checked').val();"; $script .= "if (typeof selected_service=='undefined' || selected_service===null){"; $script .= "selected_service=".$appointments->get_first_service_id().";"; $script .= "}"; $script .= "$('.app_service_excerpt').hide();"; $script .= "$('#app_service_excerpt_'+selected_service).show();"; if ( $autorefresh ) { $script .= "window.location.href='".$href."'.replace(/__selected_service__/, selected_service);"; } $script .= "});"; $script .= "$('.app_services_button').click(function(){"; $script .= "var selected_service=$('.app_select_services radio:checked').val();"; $script .= "window.location.href='".$href."'.replace(/__selected_service__/, selected_service);"; $script .= "});"; But its still not working
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.