AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
9.0.4 How does add-to-cart actually work?
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
I see this code in the /Views/Product/_AddToCartLink.cshtml view file Code:
<div class="buttons">
@if (AddToCart)
{
<button class="btn btn-primary btn-add-to-cart btn-sm" data-productid="@Model.Id">@GetResourceString("retail.addtocartlink.add_to_cart")</button>
}
else
{
<button href="@Url.Content(Model.NavigateUrl)" class="btn btn-primary btn-view-details btn-sm">@GetResourceString("retail.addtocartlink.view_details")</button>
}
</div>
But there's no click event. There's no form tag for handling a postback. How does this even work?
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
You can see the click listener on id i-e btn-add-to-cart in website/scripts/app.js
|
|
|
|
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
Oh ok.
So if I want to use that partial view to put an add to cart button on my custom view, I must also make sure I include app.js?
Or is app.js included in all pages already?
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
Its included on all pages.
|
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
9.0.4 How does add-to-cart actually work?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close