AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
Trouble with Add To Cart link in custom partial view
Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 303
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
We are working on a site where they show the product upsells in a tab on the product page instead of a page after something is added to the cart. I have created several different layouts for the productitemdisplay because they require the display to be different in different places and the one for the product accessories has problems with the add to cart link. If I put the button at one location in the code, it redirects to the accessory product page instead of adding to the cart. If I put it in another location, it adds to the cart fine. Here is my code- the first add to cart button redirects to the accessory product, but the second one adds to cart. Do you have any ideas why? Code: _ProductItemDisplayAccessories.cshtml.txt (4kb) downloaded 2 time(s). 2021-02-23_10-38-44.png (44kb) downloaded 0 time(s).
|
|
|
|
Rank: Administration
Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered Joined: 10/5/2018(UTC) Posts: 175
Thanks: 8 times Was thanked: 17 time(s) in 15 post(s)
|
If the product you are adding via add to cart has upsell attached then it will redirect to the accessories page otherwise it will send to the basket page.
|
|
|
|
Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 303
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
That isn't the issue. The product I am adding is an upsell product, located at the bottom of the main product page. I have commented out the code that redirects to the accessory page when the main product is added anyway. The first add to cart link redirects to that accessory product's product page. The second add to cart link adds to the basket, but the client doesn't want it in that location- they want it in the location of the first button. Thanks for your help.
|
|
|
|
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)
|
I copied paste your _productItemDisplay html in my local copy and tried to reproduce the issue but I am unable to.
Are there any other steps that I should follow to reproduce the issue?
Also is there any customizations being done in _AddToCartLink.cshtml view file?
|
|
|
|
Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 303
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
I figured out what the issue was, but don't know why since I'm not a CSS guru. If I took the class="product-permalink" out of the product url, the button works. There must have been some overlapping because of the styles. Weird. Thanks
|
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
Trouble with Add To Cart link in custom partial view
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