Hi all,
I’m trying to figure out if this is possible. I’ve tried it out and all I get is a JavaScript error.
I would like to know if it’s possible to place EE tags inside a block of jQuery.
Basically I’m using “Switch” and “Case” and setting variable values based on a channel entry with a Matrix field. I’m pretty sure the issue is with the Matrix loop tags wrapping my Case because my “Default: item_price =” code is working perfectly.
Here’s my code for reference:
{exp:channel:entries channel="store_pricing_shipping" entry_id="174"}
[removed]
jQuery(document).ready(function($){
$('#size_option, #frame_option').change(function() {
var option = $('#size_option').val() +" "+ $('#frame_option').val(), item_price;
// set span
switch (option) {
// BEGIN EE TAGS
'{my_matrix_field}'
case "{optionA} {optionB}":
item_price = "{item_price}";
shipping_price = "{shipping_cost}";
break;
'{/my_matrix_field}'
default:
item_price = "{my_matrix_field limit='1'}{item_price}{/my_matrix_field}";
// END EE TAGS
}
// More jQuery
});
});
[removed]
{/exp:channel:entries}