css problems

  • Posts: 490
  • Thank you received: 2
7 years 11 months ago #244375

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.5

hi
im having problems when i select button styles to css

1. it doesn't work when i have two instances of the add to cart code

first is under the photo or image
<div class="adcart hidden-lg>
<?php
if($this->params->get('add_to_cart') || $this->params->get('add_to_wishlist')){
$this->setLayout('add_to_cart_listing');
echo $this->loadTemplate();
} ?> </div>

and the other is under the custom fields

<div class="adcart hidden-xs>
<?php
if($this->params->get('add_to_cart') || $this->params->get('add_to_wishlist')){
$this->setLayout('add_to_cart_listing');
echo $this->loadTemplate();
} ?> </div>

2. if i customize the css for the add to cart button every button is affected specially the "wishlist" button

both of them are using a.hikashop_cart_button. Can we add ids to style them separately?

3. how can we add font awesome? not through language overrides please.

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

  • Posts: 2143
  • Thank you received: 747
7 years 11 months ago #244380

Hi,

1. + 2. From what you're saying this is very basic CSS:
In #1 the wrapping divs have already now different classes, or combos of classes, and since this is your custom code, you could add even more custom classes, which you could then utilize for targeting each button with individual CSS.
Sorry, but I doubt this is the forum to go deeper into generic CSS.

3. Where? E.g. a cart icon in the button? Indeed, in good Joomla convention and tradition a language override is a legit, viable and effective way. ;) There are also the usual alternatives: CSS only, or view edition and CSS. All provided that FontAwesome is loaded in your site, of course.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
The following user(s) said Thank You: Jerome

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

  • Posts: 490
  • Thank you received: 2
7 years 11 months ago #244402

thanks

sorry im not an expert on programming so i dont understand what to do.

1. What can we do? it doesn't work if i have 2 instance of add to cart button. As you can see i made 2 add to cart buttons one to appear on large screens and one on small screens but it doesn't work. Do i need to add a code so that the two add to cart buttons would work?

2. Like i have said both of them have the same class and no id. Where is the view? how do i separate the buttons so i can wrapp them with divs?

3. my site already has FA and glyps loaded. How to add it on the view?

thanks again

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

  • Posts: 2143
  • Thank you received: 747
7 years 11 months ago #244441

1. I don't see the page where you're attempting this (link hidden and for HikaShop only?), don't know where exactly you've placed your code, and you don't tell what exactly doesn't work, or symptoms, errors or so. There could be many reasons for it, but how to tell without seeing it.

2. Again, you seem to already have separate wrapping divs, and different classes (or IDs) of these divs do let you target the elements inside individually, even if the elements have identical classes. It would lead too far, and doesn't belong here, to explain these CSS basics here, sorry, but there is plenty all over the web where you can learn CSS.

3. Depends on your specific case, eventually. Hint: see how it's done elsewhere in your site. Anyway, it's not HikaShop-related, so this sort of modifications can hardly be dealt with here.

Bottom line:
For certain modification/customizations you can receive help here, but you need to tell the whole story on what/where/how, especially if you've already started something, and make it visible, e.g. with a link.
Other modifications are beyond of what can be supported, either because it's too extensive, or it's not related to HikaShop.

So, again, a link to a page where one could see the result of what you've done so far would be a good start.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Last edit: 7 years 11 months ago by lousyfool.

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

  • Posts: 81723
  • Thank you received: 13116
  • MODERATOR
7 years 11 months ago #244408

Hi,

1. Hard to say, we would need to look at your page. Please provide a link.

2. You don't need to add any class or id to add specific CSS for add to wishlist and add to cart buttons. It should be possible to style them differently by default already.

3. It depends where you want to add FA... Suppose that you want to add them to add to cart/add to wishlist buttons, you'll have to edit the file "quantity" of the view "product" and modify the calls to the displayButton function there to add the classes from FA that you need for each button.

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

  • Posts: 128
  • Thank you received: 2
7 years 8 months ago #250340

Hi,

I'm also trying to replace classes for buttons in the cart that are added via the "$this->cart->displayButton" function.

I'm trying to find the definition for the function arguments but I can't find the file where this function is defined.

I looked into administrator/components/com_hikashop/classess/cart.php but it is NOT there

Help please

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

  • Posts: 81723
  • Thank you received: 13116
  • MODERATOR
7 years 8 months ago #250386

Hi,

It is in administrator/components/com_hikashop/helpers/cart.php
But you can easily do that by change that call to the displayButton function with something like that: echo str_replace('old class','new class', $this->cart->displayButton(...));

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

  • Posts: 128
  • Thank you received: 2
7 years 8 months ago #250393

Great tip!

thank you very much :)

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

Time to create page: 0.059 seconds
Powered by Kunena Forum