Title: Coding New Bridge Plugin &#8211; How To? Capture URL Variable / Trigger shortcode
Last modified: August 31, 2016

---

# Coding New Bridge Plugin – How To? Capture URL Variable / Trigger shortcode

 *  Resolved [Jay](https://wordpress.org/support/users/aaronholt/)
 * (@aaronholt)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/coding-new-bridge-plugin-how-to-capture-url-variable-trigger-shortcode/)
 * Hi,
 * I’m using WordPress and WooCommerce, and I’ve used both enough to understand 
   what’s going on.
 * I’m currently working on a site now however, where the catalogue is in an iframe.
   I know it’s not ideal, but with over 22,000 regularly changing products, I don’t
   fancy attempting to maintain that.
 * I’ve imported the essential details of the catalogue so WooCommerce can add the
   product to the cart, however I’m struggling with the functionality of WooCommerce.
   It will only add-to-cart via ID, and not the SKU (which is what I require), so
   I’m going to have to build a plugin to bridge the gap.
 * I’ve posted in the WooCommerce section prior to now, and Mike has been very helpful
   with suggestions, however I assume this kind of support is outside the spectrum
   of what they’re supporting.
 * What I need to do, is…
 * I need to capture the SKU which has been passed by the iframe catalogue…
 * For example, it might be ‘[http://ecommercesite.com/add-product?sku=12345&#8217](http://ecommercesite.com/add-product?sku=12345&#8217);
 * I want to capture that ‘12345’ from the URL
 * I then want to pull the record from the database where the sku is 12345, and 
   get the ID for that product, which could be ‘678’.
 * Once I’ve got the ID, I then need that same function to run the shortcode ‘add-
   to-cart?=678’
 * Is there a tutorial which will give me some insight into how to do this, or does
   anybody have any prior experience and can offer some advice?
 * Many thanks in advance

The topic ‘Coding New Bridge Plugin – How To? Capture URL Variable / Trigger shortcode’
is closed to new replies.

## Tags

 * [Query String](https://wordpress.org/support/topic-tag/query-string/)

 * 0 replies
 * 1 participant
 * Last reply from: [Jay](https://wordpress.org/support/users/aaronholt/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/coding-new-bridge-plugin-how-to-capture-url-variable-trigger-shortcode/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
