Author |
Topic |
|
bookseller
Starting Member
24 Posts |
Posted - November 23 2006 : 03:46:02
|
Hi to all,
I was wondering if there was a list of characters that should be removed from the links working with shopaddtocartnodb.asp.
Some descriptions of our products have characters like & " and lead to carts priced 0 with an incomplete description of the product.
Which are exactly the characters that should be removed from these links ?
Thank you for your help
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - November 23 2006 : 05:56:21
|
I don't know if you need to remove them; you might just need to encode them, eg...
instead of:
mylink="name=it's really cool & great"
use:
mylink="name="&Server.URLEncode("it's really cool & great")
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
Edited by - devshb on November 23 2006 05:58:08 |
|
|
rvaga
VP-CART Super User
USA
254 Posts |
Posted - November 23 2006 : 12:19:38
|
I know one that causes 0.00 - the # sign. |
|
|
k-otic
Starting Member
49 Posts |
Posted - November 23 2006 : 17:21:52
|
Hey,
I try avoiding all these characters:
# ~ [ ] ^ &
These all seem to be used by VPASP or are reserved HTML characters - but yeh the Server.URLEncode option Simon showed would probably help remove any problems these characters might cause.
Cheers |
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - November 23 2006 : 19:13:19
|
yep; always avoid square brackets in all your data, as vpasp will interpret them as attempted template-fields/column-names.
so, for square brackets, it'll probably still break somewhere along the line even if urlencode is used.
so, yes, avoid square brackets totally.
I once tried to use the html equivalent in data for square brackets rather than a physical square bracket, but after saving the data it got reverted on the backend to a physical square bracket anyway, so I gave up in the end and just used curly brackets or normal brackets instead.
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
Edited by - devshb on November 23 2006 19:17:15 |
|
|
bookseller
Starting Member
24 Posts |
Posted - November 24 2006 : 16:07:44
|
Many thanks to all for your replies. However, I am a little perplex as I already use square brackets [ ] and they never caused any problem... which is not the case with & and ", for example.
|
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - November 25 2006 : 04:07:06
|
true; you might not get an error when adding the product to the cart, even if it's got a square bracket in its description, but you might get errors/problems later on in the process, depending on whether or not you're using templates for emails/order-formatting
eg when doing the merchant/customer email confirmations, if those are using templates on your setup then it might have a problem when showing the items.
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
|
|
bookseller
Starting Member
24 Posts |
Posted - November 25 2006 : 08:59:08
|
That's very bad news then because I have no way around to avoid using square brackets... but after almost 2 years of using vpasp I never had any major problem. Maybe it's because my square brackets are always closed like [ my description ] and never left open with one single bracket like [ my description. What do you think ? Anyway, many thanks for your very useful contribution. |
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - November 26 2006 : 08:35:11
|
we used to have square brackets inside some of our product data, for example, on our template-field addons that we're selling we wanted to give examples in the product pages from which we were selling the addon, so that the user can see something like:
Turn Zero Currency Amounts to blanks to allow the $ trick to work with zero amounts. Call it by using this format in your templates: $Tax: [BYZ_CCY_AMOUNT_BLANKIFNONEORZERO otax]
but it showed errors (errors on our own page that is, because we used square brackets inside our product description data, the addon itself worked/works fine) - didn't kill the site/page though, but just showed an annoying message along the lines of "BYZ_CCY_AMOUNT_BLANKIFNONEORZERO not in database"
mind you, if you're not using templates then that might not be a problem at all.
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
Edited by - devshb on November 26 2006 08:40:03 |
|
|
bookseller
Starting Member
24 Posts |
Posted - November 26 2006 : 15:51:00
|
Ok Simon: perhaps the use of square brackets should be avoided in some cases but it doesn't seem to lead systematically to errors, even when using email templates. In my case, square brackets are used in part of the product's description and give this kind of link for example: http://www.mywebsite.com/shop/shopaddtocartnodb.asp?Productname=67018.%20[author name].%20Title of the book.%20Imprint date.&price=25 I use simple email templates which only list the variables of the order like products description, taxes or postage cost. The characters which I could identify so far that led to disfunctions of the cart are & and ", which break the link and led to empty carts. Perhaps urlencode would work properly but I find easier to forbid the use of such characters on my end than to rewrite the code of the website. I will also add # ~ in order to be sure! However I noticed that my link doesn't work in this forum. Perhaps it depends on the server? I can't say. |
|
|
|
Topic |
|