Question: I am new in woo commerce. I have tried with this code But it is not working 

```
function contact_concierge() {
  return '<a class="fsfb" href="'.site_url().'">CONTACT CONCIERGE</a>';
}
add_action('woocommerce_after_cart', 'contact_concierge');

```

I want to add the button after the singple page add to cart table. PLease help me.

Answer: 
You can use `mapply` and `set` with a for loop. There may be more efficient ways

```
for(j in c('B','C')){
    set(dt, j = j, value = mapply(FUN = '[', dt[['A']],dt[[j]]))
}
 dt
#      A B C
# 1: X,Y X Y
# 2: J,K K J

```
Hi does this work for you ?

```
dt$B <- apply(dt, 1, FUN = function(x) x$A[x$B])
dt$C <- apply(dt, 1, FUN = function(x) x$A[x$C])
dt
#     A B C
#1: X,Y X Y
#2: J,K K J

```