---- dataentry ----
type : integration # do not change this line
system : MODx
name : PHx raw url encode
description : Clean up your "add to cart" links with a custom PHx modifier
tags : validation
date_dt :
version :
developer_url :
----
====== PHx Raw URL Encode ======
//**Please note:**//
The code on this page is submitted by members of the FoxyCart community, and may not verified by FoxyCart.com LLC in any way, shape, or form. Please double check the code before installing. If you need help with it please [[http://forum.foxycart.com/|post in our forum]], but if we cannot offer assistance (due to unfamiliarity with this particular system or language) we apologize in advance.
This is a simple PHx plugin to allow you to [[http://www.php.net/rawurlencode|raw URL encode]] values that might be in your "add to cart links"
===== Why you'd want this =====
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).
===== The Code =====
Create a new snippet called ''phx:rawurlencode'' and paste the following into it.
===== Usage =====
Pretty simple. First, make sure you have [[http://wiki.modxcms.com/index.php/PHx|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:
Add to Cart
You'd do this instead:
Add to Cart