# Add custom button to add product to cart from non-store page

**URL:** <https://forum.wixstudio.com/t/add-custom-button-to-add-product-to-cart-from-non-store-page/52865>\
**Category:** Ask the community\
**Tags:** wix-stores-backend, code, wix-stores\
**Created:** [October 3, 2023, 11:50pm UTC](https://forum.wixstudio.com/t/add-custom-button-to-add-product-to-cart-from-non-store-page/52865 "2023-10-03T23:50:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blow\_Corp](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/blow_corp/32/83301_2.png) [@Blow\_Corp](https://forum.wixstudio.com/u/Blow_Corp)\
**Post date:** [October 3, 2023, 11:50pm UTC](https://forum.wixstudio.com/t/add-custom-button-to-add-product-to-cart-from-non-store-page/52865/1 "2023-10-03T23:50:45Z")

</div>

Hi there,  
I’m looking for a way to allow users to immediately add a product to the basket from the landing page, without having to link to the product page first and then add it from there.

Not too savvy with code, which is where I think the answer would be, linking SKU to a onClick event… of sorts. Am I close? 😂

---

<div class="post-metadata">

**Author:** ![simen](https://avatars.discourse-cdn.com/v4/letter/s/7cd45c/32.png) [@simen](https://forum.wixstudio.com/u/simen)\
**Post date:** [October 4, 2023, 8:11am UTC](https://forum.wixstudio.com/t/add-custom-button-to-add-product-to-cart-from-non-store-page/52865/2 "2023-10-04T08:11:00Z")

</div>

If you use a dataset you dont need any code. How are you displaying the products that the user can add to the basket?

---

<div class="post-metadata">

**Author:** ![Pratham](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/pratham/32/119586_2.png) [@Pratham](https://forum.wixstudio.com/u/Pratham)\
**Post date:** [October 4, 2023, 9:41pm UTC](https://forum.wixstudio.com/t/add-custom-button-to-add-product-to-cart-from-non-store-page/52865/3 "2023-10-04T21:41:23Z")

</div>

This should help:

> **[addToCart - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/wix-ecom-backend/cart/addtocart)**
>
> Adds catalog line items to a cart. The addToCart() function returns a Promise that resolves to the updated cart when the specified items have been added. Note: ...

You will need to find out the product id of the particular product that you want to add, and call the function on button click.
