Add to Cart styling

  • Posts: 33
  • Thank you received: 0
13 years 2 weeks ago #31988

Hi Nicolas,

I'm trying to style the 'add to cart' area of my products pages, but running into a few problems that I can't find how to solve.

I want to use a custom buttom behind the words 'add to cart', set Button Style to CSS in the configuration area and edited this to suit my needs:

a.hikashop_cart_button, a.hikashop_cart_button:hover{
background-image:url("../images/button.jpg"));
width:158px;
height:27px;
color:#FFF;
font-family:Verdana,Arial,Helvetica,sans-serif;
font-size:14px;
padding:5px 8px;
text-decoration:none;
cursor:pointer;
float:left;
white-space:nowrap;
text-transform:uppercase;}

However, dit has no effect whatsoever, still only see the text, no button.

Also I want to move the characteristics dropdown to the right of the content area, but keep the word 'size' to the left and make the options dropdown a lot wider, how can I achieve this? I want to move the add to cart button to the right as well underneath the dropdown. Been looking at css but can't find how to accomplish this, any help much appreciated!

Please see attached pic, this is how I've currently got it to look, but need to change to above description.

Many thanks for your help!
Johanna

Attachments:

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

  • Posts: 83025
  • Thank you received: 13405
  • MODERATOR
13 years 2 weeks ago #32022

Hi,

Are you sure that you're displaying your buttons as links and not buttons (there is the option "Button style" in the Display tab of the configuration to change that) ? That would explain why your CSS is not applied.

To align the dropdown to the right, you could do like that:
.hikashop_product_characteristics_table{ width:100%; }
.hikashop_product_characteristics_table td{ text-align:right; }

For the width of the dropdown, the class name is dynamic. You should use firebug to get it and apply a width on it.

And to align the add to cart button on the right:
.hikashop_product_stock table{
width: 300px;
float: right;
}

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

  • Posts: 8
  • Thank you received: 0
13 years 2 weeks ago #32066

Hi

I have a similar problem

I have just moved from Virtuemart to Hikashop Essential so am still feeling my way around what you can do

How do i style my add to cart area without affecting the mini-cart display?

e.g. on my site here www.compostablegreenbag.co.uk/index.php/...-26-17-00-55/caddies

I want the add to cart to line up price and Quantity - but on the minicart I don't want the word "price" just x items for £x

many Thanks

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

  • Posts: 33
  • Thank you received: 0
13 years 2 weeks ago #32068

Thanks so much for your help, Nicolas. I've got the button to work, turns out I had a typo in the background-image css line, sorry!

A few more questions....

How do I make the dropdown field to have equal widths for all characteristics? Is that even possible? Please see attached screenshot to illustrate what I mean.

Also, now that my 'add to cart' button works, I notices it appears in the little pop up when item is added to cart, as well as in the mini-cart module and on the checkout page. I only want it to appear once on the product page. How do I fix that?


Thanks so much for your help!
Johanna

Attachments:

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

  • Posts: 33
  • Thank you received: 0
13 years 2 weeks ago #32071

Sorry, another query....

How do I remove the 'image' field on the checkout page? It's on the far left next to 'name' in the list of items added to cart.

Many thanks!!
Johanna

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

  • Posts: 83025
  • Thank you received: 13405
  • MODERATOR
13 years 2 weeks ago #32100

Hi,

@Comdev:
I can see that you added the word "price" via a translation override. But for prices, if you just what that on the product page, you should rather edit the file "show" of the view "product" and add your text just after :
<span id="hikashop_product_price_main" class="hikashop_product_price_main">

@jcwerb:
If you want to fix the width of the characteristic dropdowns you can do that with CSS too:
.hikashop_product_characteristics_table select{ width: 300px; }

For the add to cart button, that's because you should do:
.hikashop_product_page a.hikashop_cart_button,.hikashop_product_page a.hikashop_cart_button:hover{
instead of:
a.hikashop_cart_button, a.hikashop_cart_button:hover{

If you want to remove the images on the checkout, you should turn off the option "Show image" in the Checkout tab of the configuration.

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

  • Posts: 33
  • Thank you received: 0
12 years 11 months ago #36665

Hi Nicolas,

Thank you very much for your help! I have now found out that too many characteristics makes the site fall over and is also a nightmare as prices have to be entered individually for many different combinations whilst I can just as well use custom fields on the products pages as many options are independent of price.

In attached screenshot you will see one characteristic on which pricing will be based: size. The quantities will be set in the 'manage variants' window and pricing will be derived from that.

The options below that are the custom fields which are independent of size/price. I want these to look the same as the characteristic name and inputbox style and also have the tooltip with the small 'i' icon. I tried adding the script like I have done for the characteristic in the name field:

{qluetip title=[<img src="../../../test/images/InfoButton1.jpg" style="float:right" />]}We accept files in various formats. Please see our FAQs for further information on sending artwork.{/qluetip}Send Artwork

However, this does not work when I add it to the name label of the custom field. How can I achieve the same in the custom fields?

Many thanks for your help!

Attachments:

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

  • Posts: 83025
  • Thank you received: 13405
  • MODERATOR
12 years 11 months ago #36730

For that you should use a translation override.

Int he label of your custom field, enter that:
MY_FIELD

Then, in your language override (in the Language tab of the configuration of HikaShop) add this:

MY_FIELD="{qluetip title=[<img src='../../../test/images/InfoButton1.jpg' style='float:right' />]}We accept files in various formats. Please see our FAQs for further information on sending artwork.{/qluetip}Send Artwork"

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

  • Posts: 33
  • Thank you received: 0
12 years 11 months ago #36792

Many thanks, that works brilliantly :-)

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

  • Posts: 4
  • Thank you received: 0
11 years 10 months ago #89487

Hi Nicolas, hi everybody

i've a little problem: i'm looking for the php file which generates the css class "hikashop_cart_button".

I need to cusomize the php file and NOT the CSS one, can you help me providing the path of this file?

Thanx in advance,

Best Regards,

Marietto


"do or do not. there is no try"

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

  • Posts: 4
  • Thank you received: 0
11 years 10 months ago #89543

Ok, i found it! If anybody is interested, the path is /administrator/components/com_hikashop/heplers/cart.php and there look at the line 60!

bye,

Marietto!


"do or do not. there is no try"

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

  • Posts: 1
  • Thank you received: 0
11 years 5 months ago #114603

Old topic bump!

MariettoR - thanks - saved me a lot of time searching for this! But I'm a bit hesitant to edit this - it's a core file. I notice in the code (line 35ish), it has:

$chromePath = JPATH_THEMES.DS.$app->getTemplate().DS.'html'.DS.'hikashop_button.php';

Can I just create a copy of cart.php and put it my templates/[template-name]/html folder?

EDIT: as a quick workaround, you can just edit /templates/[your-template-name]/html/product/quantity.php (or wherever else you need to change buttons) by editing the displayButton call.

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

To this (note the extra paramater on the end - I'm adding a class "button"):
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$max,$min,'button');

The class parameter immediately follows the min parameter. This approach allows you to add a class to a given button call, which you can then override with CSS. In my case, I'm adding the class of "button" and completely removing Hika styling as my themes (by RocketTheme) already have a bundle of good to go styling ready for anything.

Last edit: 11 years 5 months ago by Spanka.

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

Time to create page: 0.102 seconds
Powered by Kunena Forum