Button bootstrap classes, how are they applied.

  • Posts: 57
  • Thank you received: 5
10 years 11 months ago #137875

Hi Hika team,

I am creating a custom design for my hika product thumbs and I would like to switch the input button bootstrap classes to .btn .btn-inverse.

I am having a hard time locating the file where I can change the css class.

Originally I though that I have to edit my listing_img_title view, however the "add to cart" area contains php statements.

PHP is not my strong side at all, but I assume that the solution I am looking for is contained within this line:

<?php
if($this->params->get('add_to_cart') || $this->params->get('add_to_wishlist')){
$this->setLayout('add_to_cart_listing');
echo $this->loadTemplate();
}?>

I believe the "add_to_cart" should evaluate to true and then "loadTemplate" will call my add to cart button. In this line of thought I need to locate the file that the "echo $this->loadTemplate();" calls.

Where is this file located?

In the event I am completely wrong.

Where can I change the class of the add to cart button to be "btn btn-inverse"

Kind regards.

Drago.

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
10 years 11 months ago #137896

Hi,

To do that, you need to edit the file "quantity" via the menu Display>Views and change the line:

echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$max,$min);
to:
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$max,$min,'btn-inverse');

The following user(s) said Thank You: Hristov

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 5
10 years 11 months ago #137900

Hi Nicolas,

Thanks for your quick response. It works.

An additional question regarding the same topic.

I can definitely see in the future where I would like to create a custom add to cart button that is not based on bootstrap. However I would still like to keep the bootstrap design.

In short - keep "use bootstrap design" -> "yes", in the configuration and remove the bootstrap "btn button" classes from the "add_to_cart" button.

Please Log in or Create an account to join the conversation.

  • Posts: 26166
  • Thank you received: 4029
  • MODERATOR
10 years 11 months ago #137907

Hi,

I am sorry but it won't be possible unless you modify the HikaShop core.
Using the bootstrap design means using the class "btn" for the buttons, because it is the bootstrap design way.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum