variant.incoming and jQuery

Tourist
8 0 9

Looking for a bit of help on this one.

I have a theme with jQuery that updates the stock levels on the page - nothing new about that.

I wrote some code to interpret transfers and the variants - displaying if there is incoming inventory.

I want this to change in real time when variants are selected.

  if (variant.incoming) {
     if (variant.next_incoming_date!=null){
      jQuery(".product-stock-due span").text(variant.next_incoming_date);
    } else {
      jQuery(".product-stock-due span").text(" Soon ");
      }
  } else {
    jQuery(".product-stock-due span").text(" None Due ");
  }

no matter what I do - it will not update the span with the correct data - I know there are variants of the same product that have incoming inventory and some that do not.

Everything else working and I can see jQuery is updating the span - just never shows anything but the None Due default.

A process of testing as best I can seams to indicate tha the variant.incoming is not returning "true" as it should - because there is a transfer in place for variants of the product.

Any ideas?

0 Likes
Highlighted
Tourist
8 0 9
0 Likes