Post by Zviadi » Wed Sep 24, 2008 1:27 am

when i click on the product at the home page i would like to add this product to cart directly without additional product info page

please help

New member

Posts

Joined
Sun Sep 14, 2008 7:11 pm

Post by Qphoria » Wed Sep 24, 2008 1:40 am

There is a conversation about this happening here:
http://forum.opencart.com/index.php/topic,1809.0.html

It's about to be released as a contribution for the category list, was looking into making it available on the home page too.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Zviadi » Wed Oct 15, 2008 2:52 pm

thanks but,

i think that does not solve my problem,  i dont need product options, i just need products to be added to the cart   directly when clicking on  it,   at the home page,   i know thats not a huge  problem and i would really appreciate if someone could help me with this, thanks.
Last edited by Zviadi on Wed Oct 15, 2008 2:54 pm, edited 1 time in total.

New member

Posts

Joined
Sun Sep 14, 2008 7:11 pm

Post by jty » Wed Oct 15, 2008 7:00 pm

Zviadi wrote: if someone could help me with this, thanks.
Mr Search helps me. I love Mr Search  :D
It is in here. I found it one night but I can't quickly find it again so try this

in the file opencart\catalog\controller\category.php

Code: Select all

line 72 add under $product_data[] = array( 
Code:
	'id' => $result['product_id'], // Added for Add TO Cart button on Category Page
then line 79 add:

Code: Select all

// Added for Add TO Cart button on Category Page
		$query = array(); 
 		$view->set('action_cart', $url->href('product', FALSE, $query));
 // END Mod

now in the file opencart\catalog\template\category.tpl

add

Code: Select all

"<form action="<?php echo $action_cart; ?>" method="post" enctype="multipart/form-data">"
after

Code: Select all

"<div class="products">"
line

then add

Code: Select all

"<input type="hidden" name="product_id" value="<?php echo $product['id']; ?>" />
    <input type="submit" value="Buy Now" />
</form>"
after "" line before ""

If that's not it, then ask Mr Search
If it is it, can you post back here please so others can find it. Thanks.

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Wed Oct 15, 2008 9:28 pm

Zviadi wrote: thanks but,

i think that does not solve my problem,  i dont need product options, i just need products to be added to the cart   directly when clicking on  it,   at the home page,   i know thats not a huge  problem and i would really appreciate if someone could help me with this, thanks.
Well it would help your problem. Options are just one part of it. The other part of it is to add an "Add to cart" button as well. Currently it doesn't do this for the home page, only the category page, but it is planned. For now, jty's method should do what you want.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 1 guest