Replace + - quantity buttons with button group

  • Posts: 34
  • Thank you received: 1
11 years 3 months ago #116605

Hi,

I'm a little bit stuck here with trying to replace the quantity +- buttons on the product page. I'd like to replace them with the bootstrap button group ( getbootstrap.com/2.3.2/components.html#buttonGroups ). I've tried locating the php file in the display --> views in the backend to customise from there, but can't find it. Would appreciate any help. Thanks.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 months ago #116628

Hi,

It's actually not possible to edit a view for the quantity buttons, they are in the file "administrator/components/com_hikashop/helpers/cart.php", so you have to make an override as explained in this tutorial:
www.hikashop.com/support/documentation/6...tation.html#override

The following user(s) said Thank You: ximbo

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

  • Posts: 34
  • Thank you received: 1
11 years 3 months ago #116663

So I can't just go to displays-->views in the backend?

From the link you gave me, I understand that I need to copy the cart.php file from administrator/components/com_hikashop/helpers/cart.php and place it in templates/YOUR_TEMPLATE/html/ - editing it as I want and it'll work as an over-ride?

EDIT:

Just figured it out - thanks for pointing me in the right direction, the relevant bit of the help file there is:

For the quantity input:
You need to create the file templates/YOUR_TEMPLATE/html/hikashop_button.php. We invite you to look at the file administrator/components/com_hikashop/helpers/cart.php for the default code of the function you will define in it. In that file, you will be able to define the function:
hikashop_quantity_render($html,$i,$max_quantity,$min_quantity) => The $html variable will contain the HTML of the "add to cart" button, the $i variable will contain a unique int which will be different for each quantity input on the page, the $max_quantity and $min_quantity will contain the min and max quantity possible for the product. You need to return the whole HTML at the end of your function.
Also, please note that it only works if the option for "Display the quantity field on the product page" is set to "Ajax Input" in the configuration of HikaShop.


So I just defined that function and wrote my own html to return..makes sense once you look at the cart.php file.

Last edit: 11 years 3 months ago by ximbo. Reason: solved

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

Time to create page: 0.076 seconds
Powered by Kunena Forum