Cart Links issue

Posts: 45
Joined: 09/03/2007

installed cart links and activated module.

My first product is what I'm testing here.

When I try the following link:
/cart/add/e-p1_q1?destination=cart

I get the message: XX is not a product, unable to add to cart.

XX is a product.

I've tried using the product node name, etc, but no luck.

Input?

Posts: 5245
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Hmm... so is the node ID of the product 1? You can tell if when you go to edit the product it shows a URL of node/1/edit.

Posts: 45
Joined: 09/03/2007

Ok, it is actually node/37/edit

tried 37 after p and it worked.

I really wasn't sure what to use for the product ID.

Thanks.

Posts: 5245
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Ahh, yeah that could be a problem. You can adjust the settings to show you the link to use when adding a product to a cart w/ the add to cart form. It will show you a message containing the base link to use to get the product w/ the right ID, Qty, and attributes/options.

Posts: 1290
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

I suggest a small snippet / hack of the core Cart Links API or uc_product module that would auto-generate a link for that product. I think it'd be a tiny bit of work because you'd have to provide logic for Options (whether or not they exist for that product).

But for instance on each Edit Product screen you have a Cart Link hyperlink, that when you right-click and choose "Copy shortcut" or "Copy link location" etc., the link provides the usual values. There would obviously still be work involved, mainly in the decision of what to store the link as in the Click Tracking table (would have to logically add this value initially, dependant on whether tracking clicks is enabled) and also, if need be, changing the number of qty to add to the cart.

Then when you go to the Options screen (or this could be included on the main screen) you're given links for each Option/Attribute combo, where you can copy the link and paste into a given scenario.

I think something like that might be helpful, I know that in my travels configuring the site I had to come back to the documentation several times (during creation of product templates and views, as well as some banner ads) each time I forgot the format for creating a new link. It'd be more of a convenience so of course I wouldn't make it a top priority.

Guess I could start work on a Contrib too... Smiling Or a patch?

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 5245
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

hehe If you could patch the cart links module for that, I'd give you a cookie. I almost think it would have to be handled by altering the add to cart form and adding a separate button called "Create cart link" that an admin could click instead of "Add to cart". I'd add a fieldset in there that they could use to specify the ID, whether to empty the cart or not, etc. It just wasn't something I could get to at the time the module was written.