15 replies [Last post]
rdentry's picture
Offline
Joined: 09/18/2007
Juice: 33
Was this information Helpful?

Is it possible to automatically insert something into a cart? I would like the user to click on a link that takes them to a cart with a product already inserted.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: automatically insert to cart

That's something that's been on Ryan's list o' things to do. It seems like there's always something else that needs to be done first, though.

mikejoconnor's picture
Offline
AdministratorBug FinderGetting busy with the Ubercode.
Joined: 08/07/2007
Juice: 536
Re: Re: automatically insert to cart

what about an uc_cart_add_item($nid, $qty)

You could then create a menu callback for uc_cart_add_item, with the node id and quantity arguments.

kulvik's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer
Joined: 08/14/2007
Juice: 336
Re: Re: Re: automatically insert to cart

If this is just about adding a product to cart throught a regular link (not form) we have already made some code for this. I'll tell Erlend to post it out here.

______________
Best regards,
Thomas Kulvik
Ny Media AS
www.nymedia.no

zmove's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 1192
Re: Re: Re: Re: automatically insert to cart

Cool kulvik, I think a lot of people will be interested by that. Me include.

Does it work with attributes options ? to directly add a product with attribute ? it could be a very good things too.

StephenGWills's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/07/2007
Juice: 414
zMove, Do I understand that

zMove,

Do I understand that your uc_extra_column module satisfies the requirements of this thread? If so, could I see a snippet that utilzes this feature properly so that I can embed an add to cart mini form in an arbitray node?

My target node is actually a book page.

Thanks

zmove's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 1192
Hi, My module just add on

Hi,

My module just add on product listing the same button with attribute selection you can find when you enter in the full node.

It's not the same thing that provide a a fuction that allow tu put a link that automatically add a defined product when you click on it.

zmove

StephenGWills's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/07/2007
Juice: 414
Re: Hi, My module just add on

Thank you, I believe you have clarified this for me. Just to be sure that my understanding is correct, do I understand that on my catalog product page, I will now have the attributes and "add to cart button" for each product shown and therefore I do not have to click a product and move past the catelog page into a product detail node before I can add that product to my cart?

zmove's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 1192
Re: Re: Hi, My module just add on

It's that, but you can try it. You will see, by example, what I mean Smiling.

In addition, the module don't install table in your database, so, by just unchecking it in the module listing, you can remove it cleanly.

StephenGWills's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/07/2007
Juice: 414
Re: Re: Re: Re: automatically insert to cart

Hear! Hear! This implementation will be a life-saver for me. I have managers waiting with baited breath! Smiling

Awesome!

rdentry's picture
Offline
Joined: 09/18/2007
Juice: 33
Re: Re: Re: Re: Re: automatically insert to cart

Anybody know how to contact Erlend to get this code posted?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Re: Re: Re: automatically insert to cart

You can go visit him in Norway. Cool

(Alternatively, you can private message him through our site - he's quaoar.)

rdentry's picture
Offline
Joined: 09/18/2007
Juice: 33
Re: Re: Re: Re: Re: Re: Re: automatically insert to cart

Thanks Ryan

kulvik's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer
Joined: 08/14/2007
Juice: 336
Re: Re: Re: Re: Re: Re: Re: automatically insert to cart

Hi guys. Sorry about that. I posted some code in another thread here:

http://www.ubercart.org/forum/support/360/possible_add_products_cart_tex...

It's about the same thing. That simple code does unfortunately not work with attributes yet. We just needed it for some quick functionality on one of our sites.

______________
Best regards,
Thomas Kulvik
Ny Media AS
www.nymedia.no

StephenGWills's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/07/2007
Juice: 414
Re: Re: Re: Re: Re: Re: Re: Re: automatically insert to cart

There is a LOT of overhead in this solution, but I have the add-to-cart thing licked by using Bwv's node view technique as seen here:

http://www.ubercart.org/contrib/96

this got the attributes in as well.

kulvik's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer
Joined: 08/14/2007
Juice: 336
Re: Re: Re: Re: Re: Re: Re: Re: Re: automatically insert to cart

Ok i'll give that a go.

Overhead: I know, but as I said.. we needed this in 15 minutes or less Sticking out tongue

______________
Best regards,
Thomas Kulvik
Ny Media AS
www.nymedia.no