Configuring 'add to Cart' Button on homepage featured collection - Theme Prestige

XRISIS
New Member
2 0 0

Hi everybody,

I am seeking help with my Prestige shop theme. I would like to configure an 'add to Cart' Button on the homepage featured collection - I have searched around a bit and apparently

one would have to edit the HTML code of the liquid.cart file. But that is all the in fo I got.

I looked into the code but could find where this is addressed.

Anyone can offer some help?

My store is 

www.XRISIS.af

Thanks

Replies 6 (6)
miniscript
Excursionist
25 1 9

Hey you need to enable Add to cart functionality on homepage  -

To do so you need to have the following things - 

Fetch real Products on homepage using a collection not just with URL. Once you have the products go to your product page and search for <form> with class name 'ProductForm' so copy that form integrate into the products which you're showing on homepage. 

XRISIS
New Member
2 0 0

Thank you for your suggestion. Could you maybe go more into detail? Where would you suggest putting in the copied code?

Cheers

Regina

miniscript
Excursionist
25 1 9

Hi - You need to first fetch the collections on homepage using this code 

<div class="homepageproducts">
   
    {% for product in collections['homepage-collections'].products %}
    <div class="c-upsell__product js-product" data-product-id="{{ product.id}}">
        <div class="c-upsell__productImage">
            {% comment %} Fetch Product Images{% endcomment %}
            {% for image in product.images %}
            <img class="c-upsell__innerImage" src="{{ image | img_url: '586x' }}" alt="Product Img" />
            {% endfor %}
        </div>
        {% comment %} Fetch Product title & Price {% endcomment %}
        <h2 class="c-upsell__productTitle">{{ product.title }} </h2>
        <p class="c-upsell__productPrice"> {{ product.price }}</p>
        {% comment %} Add to Cart Button {% endcomment %}
        <form method="post" action="/cart/add">
            <input type="hidden" name="id" value="{{ product.variants.first.id }}" />
            <input min="1" type="number" id="quantity" name="quantity" value="1"/>
            <input type="submit" value="Add to cart" class="btn" />
          </form> 
    </div>
    {% endfor %}
</div>
Arslan_Mumtaz
Tourist
7 0 0

Like here i did that. you want to do the same thing ?

Screenshot_2021-02-10 Liberty Noir Premium Jewellery.png

Shopify Expert | Arslan
Want to modify or custom changes on store hire me.
Skype : arsal.33
Mail : arslan.mumtaz04@gmail.com
Web; shopifydepartment.com
Tumyza
New Member
1 0 1

@Arslan_Mumtaz please I need to do the same on prestige theme, how did you manage it ? 
Thanks for your help

Nikhil344
New Member
1 0 0

{% comment %} Add to Cart Button {% endcomment %}
<form method="post" action="/cart/add">
<button style="margin-top: 4px;" type="submit" name="add" aria-label="Add to cart" class="ad_to_cart_coll Button Button--primary">
Add to cart</button>
</form>


Add the following code in product-item.liquid