Removing the You Live in California Checkbox from Market Selector
Admin: eCommerce Admin Page: Advanced Customization > Javascript Insertion URL: {client_ID}.retailadmin.directscale.com/#/Insertion
The Market Selector in the eCommerce Shop features a You Live in California checkbox.
If you would like to remove this checkbox, you can add a JavaScript Insertion.
Adding an Insertion
- In the JavaScript Insertions page, click + ADD INSERTION.
 - Select Custom Script from the Insertion Type menu.
 - Enter a sort Name.
 - In the JavaScript Code Editor, paste the following code:
 
try {
	var removeLiveInCaliforniaCheckbox = function () {
		angular.element(document).injector().invoke(['$state', 'userService','$rootScope', function ($state, userService,$scope) {
		$scope.removeLiveInCalifornia = true;
		}
		]);
	};
  setTimeout(function () {
	 	removeLiveInCaliforniaCheckbox();
	 }, 100);
   angular.element(document).scope().$on('$stateChangeSuccess', function (event, toState, toParams, fromState) {
			setTimeout(function () {
				removeLiveInCaliforniaCheckbox();
			}, 100);
	});
} catch (e) {
	console.log('e', e);
}📘Note
The RemoveCaliforniaDropdown and Remove LiveInCalifornia toggles, found in Company Settings > Settings, do not work.
Updated 5 months ago

