Title: How to write a function
Last modified: August 21, 2016

---

# How to write a function

 *  [nicolethompson8](https://wordpress.org/support/users/nicolethompson8/)
 * (@nicolethompson8)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/how-to-write-a-function/)
 * Hi There,
 * My experience isn’t quite advanced enough to entirely understand how functions
   work so I’ve had no success in changing this WooCommerce message as I’d like 
   to.
 * `$message = sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', get_permalink(
   wc_get_page_id( 'cart' ) ), __( 'View Cart', 'woocommerce' ), $added_text );`
 * For the Added To Cart message I would like the “View Cart” link to come AFTER
   the “*Product* successfully added to your cart.” text. But moving $added_text
   before the View Cart stuff just wouldn’t work.
 * Can someone please tell me how to arrange the terms correctly?

Viewing 1 replies (of 1 total)

 *  [bemdesign](https://wordpress.org/support/users/bemdesign/)
 * (@bemdesign)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/how-to-write-a-function/#post-4842885)
 * Have you asked checked in that plugin’s support forum? The developers *probably*
   know the code best.

Viewing 1 replies (of 1 total)

The topic ‘How to write a function’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [bemdesign](https://wordpress.org/support/users/bemdesign/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/how-to-write-a-function/#post-4842885)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
