How to trigger product:added event on Avone theme for Estimated Delivery Date?

Try to add the following code to the theme.js file:

JavaScript

// Add the Estimated Delivery Date event to the Avone theme

shopify.on('product:added', function(product) {
  // Get the estimated delivery date
  var estimatedDeliveryDate = shopify.orderDeadline.getEstimatedDeliveryDate(product);

  // Add the estimated delivery date to the cart line item
  var cartLineItem = document.querySelector('[data-product-id="' + product.id + '"]');
  cartLineItem.setAttribute('data-estimated-delivery-date', estimatedDeliveryDate);

  // Add the estimated delivery date to the order details in admin
  var orderDetailsForm = document.querySelector('#order-details-form');
  var estimatedDeliveryDateField = orderDetailsForm.querySelector('[name="estimated_delivery_date"]');
  estimatedDeliveryDateField.value = estimatedDeliveryDate;
});