---
title: Template Variables in Pop Up Notices
description: Insert dynamic details such as the product title or a cart link into customized WooCommerce popup messages.
url: "https://wpfactory.com/docs/template-variables-popup/"
updated: "2026-09-25"
category: How to
tags:
  - Popup Notices
---

# Template Variables in Pop Up Notices

## Use template variables in pop-up messages

Template variables let you insert dynamic details, like the product title or a cart link, into a customized pop-up message. [Popups for WooCommerce: Add to Cart, Checkout & More](https://wpfactory.com/item/popup-notices-for-woocommerce/) supports these variables in the **Modified HTML Content** field of a customized message. Message customization is a Pro feature.

![Messages section showing template variables](https://wpfactory.com/wp-content/uploads/pasted-image-0-3-9.png)

### Before you start

- WooCommerce, active.
- [Popups for WooCommerce: Add to Cart, Checkout & More](https://wpfactory.com/item/popup-notices-for-woocommerce/) Pro (message customization is a Pro feature).
- **Customize Messages** enabled in the Messages section.

### Where to use them

Go to **WPFactory > Popups** (also reachable at **WooCommerce > Settings > Pop-up Notices**), open the **Messages** section, and add a variable to the **Modified HTML Content** field of any message you are customizing. Write each variable in double curly braces.

### Available template variables

| Variable | Inserts |
| --- | --- |
| `{{product_id}}` | The ID of the product tied to the message. |
| `{{post_title}}` | The post or product title tied to the message. |
| `{{cart_permalink}}` | The URL of the cart page. |
| `{{myaccount_permalink}}` | The URL of the My Account page. |
| `{{shop_permalink}}` | The URL of the shop page. |
| `{{checkout_permalink}}` | The URL of the checkout page. |
| `{{terms_permalink}}` | The URL of the terms and conditions page. |

**Note:** `{{product_id}}` and `{{post_title}}` are only filled when the message runs in a context that has a product, such as the add-to-cart message. Permalink variables work anywhere.

### Examples

- Original "Add to cart" message: *"%s has been added to your cart."* Modified with a variable: `{{post_title}} has been added to your cart. View your cart: {{cart_permalink}}`
- Original "Cannot add another" message: *"You cannot add another "%s" to your cart."* Modified: `You cannot add another {{post_title}}. Browse similar products: {{shop_permalink}}`

### Ready to set this up?

Template variables are part of the Pro message customization toolkit in [Popup Notices](https://wpfactory.com/item/popup-notices-for-woocommerce/). [Get Popup Notices Pro](https://wpfactory.com/item/popup-notices-for-woocommerce/).

Related articles

- [How to Hide Specific Notices from WooCommerce Pop-Ups](https://wpfactory.com/docs/woocommerce-popup-ignore-messages/)
- [Pop-Up Notices General Options for WooCommerce](https://wpfactory.com/docs/enhancing-customer-engagement/)
- [How to Style WooCommerce Pop-Up Notices with the Customizer](https://wpfactory.com/docs/woocommerce-popup-notices-custom-style/)
- [How to Customize the WooCommerce Pop-Up Modal Template](https://wpfactory.com/docs/woocommerce-popup-modal-template/)
- [Troubleshooting Pop-up Notices for WooCommerce](https://wpfactory.com/docs/pop-up-notices-fixes/)

 

[![Popup Notices for WooCommerce: Add to Cart, Checkout & More](https://wpfactory.com/wp-content/uploads/Popups-for-WooCommerce_-Add-to-Cart-Checkout-More.webp)](https://wpfactory.com/item/popup-notices-for-woocommerce/)
