This is a very simple PHx snippet to allow you to raw URL encode values that might be in your “add to cart links”
This is really handy in making sure your links are valid HTML/XHTML, and in making sure that undesirable characters (like ? or &) that your clients might enter into TVs or Document Objects aren't sent to FoxyCart (which could break things).
Create a new snippet called phx:rawurlencode and paste the following into it.
<?php return rawurlencode($output); ?>
Pretty simple. First, make sure you have PHx installed and set up correctly. Then create the snippet as noted above.
Then, you simply call the customer PHx modifier where necessary. If you were planning on making a link (in a chunk or template or whatever) like this:
<a href="https://YOURDOMAIN.foxycart.com/cart?name=[*product_title*]&price=[*price*]">Add to Cart</a>
You'd do this instead:
<a href="https://YOURDOMAIN.foxycart.com/cart?name=[*product_title:rawurlencode*]&price=[*price*]">Add to Cart</a>