Add custom icon before add to cart text
- condorazul
-
Topic Author
- Offline
In wich view and where should i insert the code, thank you
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
You'll just have to :
- Go to "Hikashop->Display->Views"
- Edit the "Cart" file of the "Product" view of your front-end template
- Add your image at the beginning of the file :
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
?><span class="icon-cart"></span>
and the button shows in the cart or mini cart
where i want it to be displayed is in the buttom add to cart in the product listing
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
So you have to place the desired code earlier in that view to have if before the button
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
Simply ass a translation override like that:
ADD_TO_CART="<span class='icon-cart'></span>Add to cart"
www.hikashop.com/download/languages.html#modify
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
So if you change the "Button display method" option in the configuration, it should work fine.
Otherwise, you would have to change the line:
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$max,$min);
like that:
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$max,$min,'icon-cart');
in the file "quantity" via the menu Display>views in order to add the class directly to the submit button.
Please Log in or Create an account to join the conversation.
I have followed the instructions above... I want to add the font-awesome icon: <i class="fa fa-plus-square"></i> to before the "add to cart" button.
I added <i class="fa fa-plus-square"></i> to the language file to no avail.
Then I edited the view "quantity" changing:
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,'fa-plus-square');
in the file "quantity" via the menu Display>views in order to add the class directly to the submit button.
And this did not help either.
Any thoughts?
Please Log in or Create an account to join the conversation.
The second solution can't work because the class must be between "<i> ... </i>" html tags.
Then for the translation override, is the code displayed in the view ?
If it is, so it must maybe not be placed in a <a> tag, or you don't have the files displaying the icon loaded on your website.
Please Log in or Create an account to join the conversation.