4 replies [Last post]
ricecooker's picture
Offline
Joined: 01/02/2008
Juice: 16
Was this information Helpful?

Hi all, just wondering if anyone has experienced this? I tried it
on the admin livetest as well and it does the same thing.

Aside from the fact the "Cart Link product action" is mixed up
a#o# is showing up as o#a#...

My main issue is this: When I add a product with a textbox attribute (ie. no options)
using Cart links: eg. .../add/cart/p1_q1_a1oTEXT

it does not show up properly in Shopping cart. Only displays a number?

ie. If the attribute name was "Name on Shirt" and the user entered "Dawg"
then the shopping cart shows the attribute as "Name on Shirt: 0".

I've tried following the "Cart link product action" and it shows add/cart/p1_q1_o1aTEXT.
No hope there.

Possible bug? or is there something I'm not doing right?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Cart Links textbox attribute problem

I didn't code it to accommodate text messages, actually, so it's converting the string you enter to its integer value of 0. There's just too much to worry about adding strings to a URL like that... if someone has a good solution and wants to submit it for review I'd consider it. I did fix the other bug you mentioned, though. Thanks for catching that. Smiling

ricecooker's picture
Offline
Joined: 01/02/2008
Juice: 16
Re: Re: Cart Links textbox attribute problem

oh ok... hrm.. help anyone? Smiling

ricecooker's picture
Offline
Joined: 01/02/2008
Juice: 16
Re: Re: Re: Cart Links textbox attribute problem

OK heres what I decided to do, in uc_cart_links.module I added an extra:

// Set a textbox attribute for the product: t1sTEXT
case 't':
$attribute = intval(substr($part, 1, strpos($part, 's') - 1));
$option = substr($part, strpos($part, 's') + 1);
$p['attributes'][$attribute] = (string) $option;
break;

Which obviously removed the conversion to integer. So whenever I intend to add a textbox attribute product I use "t" instead of "a". Anyway, adds to cart beautifully except one thing:

The TEXT is always in lower case! Any way to allow both uppercase and lower?

ricecooker's picture
Offline
Joined: 01/02/2008
Juice: 16
Re: Re: Re: Re: Cart Links textbox attribute problem

nvm.. the issue was in line 201 which was converting
the strings to lower case.

(Just posting to let ppl noe in case they one day
come across a need for a adding a textbox attribute through cart links)

There's probably a better solution... but for now this will do Laughing out loud