Creating elsif/else statement for line item properties

Solved
Highlighted
Excursionist
18 2 6

I checked out the Responsive theme on a demo. Looks like the file we're after is Assets/app.js. It looks like this (from the demo theme): https://cdn.shopify.com/s/files/1/0005/4630/8159/t/36/assets/app.js?v=3653237523925683592

It does use jQuery, which is a bonus. I'd go right to the bottom of that file, and put something along the lines of:

$(document).ready(function() {
  $('#[select id]').on('change', function() {
    $('#[field id]').toggle();
    $('[field id]').prop('disabled', !$('[field id]').prop('disabled'));
  });
});

You've got to work out how the jQuery selectors work: https://www.w3schools.com/jquery/jquery_ref_selectors.asp

Now if that fails, start again from alert('hi');, see if there's a prompt or not, and work your way back up. If there's no prompt when you land on the page, wrong file. If there is a prompt, you'll need to change the JS you're putting at the bottom.

If you have trouble here, I suggest going through some JS tutorials online until you can write your own code like the bit above that does work for your page. 

1 Like
Highlighted
Tourist
10 0 1

Awesome, thanks JØhn will give it a go!

1 Like
Highlighted
Shopify Partner
438 56 67

This is an accepted solution.

@Peppalane12 

The JS code change is done, you can include it when you like. 

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution

Skype : lokendra.panwar1
1 Like