How to change the "Add to Cart" button into link format in product list page

Posts: 14
Joined: 12/26/2007

Hi all,

In my project i have to do change the "add to cart" button into "add to cart" link in product list page.

Is there any possibility to change this.

Please help me.

I have attached image for reference.

Thanks for your advance information

AttachmentSize
addcartlink.JPG59.18 KB
Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

I think the easiest thing to do is to style the Add to Cart buttons to look like links, even though the browser will still treat them like submit buttons. The main thing is to change the default background image to the transparent color, and then to add the normal link styles.

Another option is to use the Cart Links module, but with this method, you can't use the quantity or attribute fields in the Add to Cart form. Otherwise, you'd have many, many links per product.

Posts: 14
Joined: 12/26/2007

Thanks for your information

Now i am using the cart links modules. The products added successfully to cart but i used default qty=1. Is any possibility to add the attributes to the cart?

Thanks

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

I know you can, but I don't know exactly how. Something about "a" and "o" with the right ids for the attribute and option, but I didn't see it in the documentation either. Hopefully somebody can point it out for us.

Posts: 31
Joined: 10/13/2007

I know I saw an explanation about this a few months ago, but can't find it now.
Can someone please describe the format of the variable $data that holds attributes/options. (Ryan?)

Posts: 31
Joined: 10/13/2007

Looked closer and it's simply the serialized result of something like the following:

<?php
array(
      [
attributes] => array(
        [
3] => 6             // this is aid => value
        
......              // more attribute value pairs goes here
     
),
      [
shippable] => 1,
         ......             
// more options goes here
)
?>