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

```
There's probably a more elegant way to do this and it doesn't scale well but here goes...

```
dt[,A1:=lapply(A,'[[',1)]
dt[,A2:=lapply(A,'[[',2)]
dt[B==1,`:=`(Bnew=A1,Cnew=A2)]
dt[B==2,`:=`(Bnew=A2,Cnew=A1)]
dt[,`:=`(A1=NULL,A2=NULL,B=NULL,C=NULL)]
setnames(dt,c("Bnew","Cnew"),c("B","C"))

```