• Resolved wolxor

    (@wolxor)


    I have configured the plugin and it is working correctly. I have configured the plugin to pre-book a theatre performance, which means that there are multiple seats available at any given time, in my case 190 seats.

    I want to reduce the maximum number of seats a user can book, so I tried to add the script I found in the help section on the “Edit Scripts” tab:

    var cpahb_max_quantity = 8;
    
    jQuery(document).one("showHideDepEvent", function () {
      (function ($) {
        function removecapacity() {
          $(".ahbfield_quantity option").each(function () {
            if ($(this).val() > cpahb_max_quantity) {
              $(this).remove();
            }
          });
        }
        $(".ahbfield_service").bind("change", function () {
          removecapacity();
        });
        removecapacity();
      })(jQuery);
    });

    But every time I save it, it converts > to &gt ; [without the space between t and ;] and the script does not work.

    I have tried disabling all my plugins one by one, but I still get the same error.

    How can fix this problem?

    • This topic was modified 2 years, 3 months ago by wolxor.
    • This topic was modified 2 years, 3 months ago by wolxor.
    • This topic was modified 2 years, 3 months ago by wolxor.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wolxor

    (@wolxor)

    I solved this problem by modifying the code in this way:

    var cpahb_max_quantity = 9; # set the max+1
    
    jQuery(document).one("showHideDepEvent", function () {
      (function ($) {
        function removecapacity() {
          $(".ahbfield_quantity option").each(function () {
            if (Math.max($(this).val(), cpahb_max_quantity) == $(this).val()) {
        		$(this).remove();
    		}
          });
        }
        $(".ahbfield_service").bind("change", function () {
          removecapacity();
        });
        removecapacity();
      })(jQuery);
    });
    Plugin Author codepeople

    (@codepeople)

    Hi,

    Sorry for the late. Thank you for the feedback about the solution.

    Thank you for using the plugin!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘> converted into “&gt ;”’ is closed to new replies.