Close

Removing buy button from featured products and from categories

[email protected]
8 years ago
#12135 Quote
Avatar
  • 12
I would like to remove the "buy button" and "the price" from the products categories and from the featured producte.
I would like to replace it with a "Detail button"

 i cannot find the place in the code where i can change this.
Deni
8 years ago
#12147 Quote
Avatar
  • Moderator
  • 389
[email protected] wrote:
I would like to remove the "buy button" and "the price" from the products categories and from the featured producte.
I would like to replace it with a "Detail button"

 i cannot find the place in the code where i can change this.


Hi, 

Please go to this file: /Themes/Motion/Views/Shared/_ProductBox.cshtml.

The "add to cart" button is placed in the DIV element with class "buttons". Just find this code:
@if (!Model.ProductPrice.DisableBuyButton)
{
...
}

and comment it. On its place add this code:
<input type="button" onclick="window.location.href = '@Url.RouteUrl("Product", new {Model.SeName})'" class="button-2 product-box-add-to-cart-button" value="Details" />


If you want to hide the prices you can find the DIV element with class "prices" and comment it. Note that this may break the styling of the product box.


I hope this helped !
Best Regards,
Mladen Staykov
Nop-Templates.com
[email protected]
8 years ago
#12148 Quote
Avatar
  • 12
Thank you.
[email protected]
8 years ago
#12149 Quote
Avatar
  • 12
Deni wrote:
I would like to remove the "buy button" and "the price" from the products categories and from the featured producte.
I would like to replace it with a "Detail button"

 i cannot find the place in the code where i can change this.


Hi, 

Please go to this file: /Themes/Motion/Views/Shared/_ProductBox.cshtml.

The "add to cart" button is placed in the DIV element with class "buttons". Just find this code:
@if (!Model.ProductPrice.DisableBuyButton)
{
...
}

and comment it. On its place add this code:
<input type="button" onclick="window.location.href = '@Url.RouteUrl("Product", new {Model.SeName})'" class="button-2 product-box-add-to-cart-button" value="Details" />


If you want to hide the prices you can find the DIV element with class "prices" and comment it. Note that this may break the styling of the product box.


I hope this helped !