Question: Hi I'm working on Datatables and I'm just a jQuery beginner. I want to merge some of the JSON output through the DT render property. I tried this:

```
 function ( data, type, full ) {
 return full["a"] + full["b"] + full["c"] + full["d"];}

```

But this doesn't work, because when there's no C or D in the data row, an "undefined" will appear. So I turned to conditionals that will check before posting the result.

```
function ( data, type, full ) {
      if (full["a"]) {
        return full["a"];}
      else if (full["a"] && full["b"]) {
        return full["a"] + full["b"];}

```

I would then go through some iteration of this until I get all the variables I need — A, B, C, and D. Plus, this doesn't work. Any shortcut?

**Update**: I'm now using the map function, which kind of gives me the result I was looking for, but I'm still looking for some granular control of the variables. See the [fiddle](https://jsfiddle.net/east1999/0zdjy1yz/).

**Update 2**: See [here](https://stackoverflow.com/questions/41797212/granular-manipulation-of-array-variables-in-datatables) for another iteration of the same problem.

Answer: 
There is probably a shorter answer by triggering a core handler found in Woocommerce to refresh fragments via ajax.

```
function refresh_fragments() {
    console.log('fragments refreshed!');
    $( document.body ).trigger( 'wc_fragment_refresh' );
}

refresh_fragments();
setInterval(refresh_fragments, 60000);

```

This code should trigger the following function binded to 'wc\_fragment\_refresh' found in cart-fragments.js

```
function refresh_cart_fragment() {
    $.ajax( $fragment_refresh );
}

```
In my case, I just wanted to refresh the cart once for all my users since I had made a significant change to how the cart items are displayed. Going with a script would require me to remove it after some time (when I think most of my users have had their carts refreshed). I found clearing all existing Woocommerce Sessions by going to Woocommerce -> Tools and clicking `Clear` under Clear customer sessions to be better suited for my use case.