FAQ: How to hide certain available shipment frequencies?

A frequently asked question that our users have is to hide or remove certain shipment frequencies from the widget where customers can customize their frequency for a product:

To do this, you can use and change the following snippet. In the following snippet, the option “days” is hidden from the frequency dropdown:

const targetNode = document.documentElement || document.body;
const config = { attributes: false, childList: true, subtree: true };

const callback = function(mutationsList, observer) {
  // You can customise inside this callback function.
  document.querySelector("#adjust_frequency option[value='days']")?.remove()

const observer = new MutationObserver(callback);
observer.observe(targetNode, config);

Put this snippet in the Custom Code > Head field on the settings page Settings > Self Service Center.

The code within the callback function and below the commented // You can customise inside this callback function. will run every time something changes on any self service center page. Here you can then add code to remove or change certain elements on certain pages.