adding "more info" button to collection page

New Member
7 0 0

Hi, I'm looking to add a "more info" button to my collection pages.  Right now I had a "add to cart" button, and that would obviously add the item to the cart automatically, but I don't want that.  I want it to go to the product.  Just like if you were to click the image of the product, it would go to that product page.

Here's the add to cart CSS:  

<form method="post" action="/cart/add">
    <input type="hidden" name="id" value="{{ product.variants.first.id }}" />
    <input type="submit" value="add to cart" class="btn" />

and I think i can just change it to something like :

  <form method="post" action="/cart/add">
    <input type="hidden" name="id" value="{{ product.variants.first.id }}" />
    <input type="submit" value="More Info" class="btn" />

BUT I need to change the "action=" to go to product page?  if that makes sense.  

 

Thanks

0 Likes
Astronaut
1890 1 393

So you have something like this:

<form method="post" action="/cart/add">
  <input type="hidden" name="id" value="{{ product.variants.first.id }}">
  <input type="submit" value="Buy now" class="btn">
  <input type="hidden" name="return_to" value="back">
</form>

The form tag is needed if you intend to be able to add the item to cart directly from here.  Since you don't want that, you don't need the form tag.  Try replacing the above code with:

<span class="btn">More info</span>

I hope this helps.

0 Likes
New Member
7 0 0

Did that and it didn't seem to work.  It puts text under the item of "more info" but there's not a clickable button there or anything.  Just text.

0 Likes
Astronaut
1890 1 393

Sorry, I mistyped something.  Try this:  (I've updated my previous post accordingly.)

<span class="btn">More info</span>

 

1 Like
New Member
7 0 0

worked.  awesome job Alex, upvoted!  thanks!!!

0 Likes
Excursionist
28 0 2

Where does this code go? I'm using the Fashionopolism theme. 

 

I tried in stylesheet.css.liquid but no luck. 

 

Thanks! 

0 Likes