Payment Gateway Currency for WooCommerce ships one shortcode, [alg_wc_pgbc_product_price_table]. It prints a table showing a product’s price in each payment gateway’s currency, using the conversion rates you set on the Convert Currency sub-tab. It is handy for showing shoppers, up front, what a product will cost through each payment method.
Requirements #
The shortcode is registered only when Frontend info is enabled. Go to WPFactory > Payment Gateway Currency (also reachable at WooCommerce > Settings > Payment Gateway Currency), open the Convert Currency sub-tab, then the Info section, and tick Frontend info: Enable. The table only lists gateways that have a conversion rate set, so configure at least one gateway currency first.
Basic use #
On a single product page, the shortcode uses the current product automatically:
[alg_wc_pgbc_product_price_table]
Anywhere else, pass a product ID:
[alg_wc_pgbc_product_price_table product_id="123"]
Attributes #
| Attribute | Default | What it does |
|---|---|---|
product_id |
0 |
The product to price. When 0 (or omitted), the current product on a single product page is used. |
before |
<table><tbody><tr><th>Gateway</th><th>Price</th></tr> |
HTML printed once before the rows. Use it to open the table and add a header row. |
row |
<tr><th>%gateway_title%</th><td>%product_price%</td></tr> |
The template repeated for each gateway with a rate. Supports the placeholders below. |
after |
</tbody></table> |
HTML printed once after the rows. Use it to close the table. |
Row placeholders #
Inside the row attribute you can use any of these placeholders:
| Placeholder | Value |
|---|---|
%gateway_title% |
The gateway’s customer-facing title. |
%gateway_admin_title% |
The gateway’s admin (method) title. |
%gateway_rate% |
The conversion rate set for the gateway. |
%gateway_currency% |
The gateway’s target currency code. |
%shop_currency% |
The store’s base currency code. |
%product_original_price% |
The product price in the shop currency, formatted. |
%product_price% |
The product price converted to the gateway’s currency, formatted. |
Custom layout example #
This version prints one line per gateway showing the converted price, the currency code, and the original price:
[alg_wc_pgbc_product_price_table
before="<ul>"
row="<li>%gateway_title%: %product_price% (%gateway_currency%), was %product_original_price%</li>"
after="</ul>"]
Automatic placement on product pages #
You do not have to paste the shortcode at all if you use the Single product summary frontend info position. When Frontend info is enabled and that position is active, the plugin outputs [alg_wc_pgbc_product_price_table] on every product page for you. Remove that position if you would rather place the shortcode by hand.
Get more from Payment Gateway Currency #
The shortcode shows per-gateway pricing on your storefront. To offer those gateway currencies across every payment method, unlock all gateways with Payment Gateway Currency for WooCommerce Pro. See what Pro unlocks.