This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

oliver63178
oliver63178

plugins\tendlyname\ecommerce\assets\js\backend.js

I have this javascript that keeps on getting called on so my idea here is to get the value from the Order_setting model and check if a certain column is disabled like Order_setting::variable. So when Order_setting::variable is disabled wanted to hide the certain option from the repeater which is location on backend from Products see image.

Is this possible that I can get a value of a model from js and hide certain element from the repeater?

daftspunky
daftspunky

You could set the value in JS via a view file, then it would be available via JS

<script>
var MY_VARIABLE = '<?= OrderSetting::first()->variable ?? null ?>';
</script>

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.