Change/Remove product links in Cart template

General ShopSite user discussion

Change/Remove product links in Cart template

Postby existdissolve » Sun Mar 21, 2010 2:09 pm

By default, when I use [-- SC_Cart delete name quantity price total --] to define the fields in my cart, all of the products in the cart are hyperlinked--however, the hyperlinks direct to http://mysite.com/#productnumber--quite unhelpful.

Is there a way to modify how these links are generated (so that I can at least have a query string instead of a client-side anchor) or turn them off entirely?

I'm on the verge of running a JS script to strip these if I can't find a solution...
existdissolve
 
Posts: 5
Joined: Sun Mar 21, 2010 1:36 pm
Location: US

Postby existdissolve » Sun Mar 21, 2010 2:43 pm

Nevermind--I figured out a solution.

Since I'm rolling a 90% php-based solution, I went ahead and applied the JavaScript on the cart template. Here's what I did:

By default, all my links were going to http://hostname/#productnum

In my JS, I simply iterated over every product in the current shopping cart, replacing the useless "#" with a real query string parameter. Then, on my index.php, I added a php script that recursively determines the full path of the product and then redirects.

This isn't the prettiest solution, but definitely beats what was happening by default.
existdissolve
 
Posts: 5
Joined: Sun Mar 21, 2010 1:36 pm
Location: US

Postby Jim » Sun Mar 21, 2010 7:12 pm

If you want them "off entirely" go to Commerce Setup > Order System > Shopping Cart and uncheck the boxes in the "Product name" field.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby existdissolve » Sun Mar 21, 2010 7:35 pm

Thanks Jim-- I actually Do want the links, but definitely want more control over the urls...so JS hack it is. Now I just need to add an asynchronous lookup so that I can generate the correct URL on the fly :)
existdissolve
 
Posts: 5
Joined: Sun Mar 21, 2010 1:36 pm
Location: US


Return to User Forum

Who is online

Users browsing this forum: No registered users and 114 guests