Add quantity increment and decrement buttons

  • Posts: 57
  • Thank you received: 5
10 years 2 months ago #170541

-- url of the page with the problem -- : localhost
-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.4

Hi Hika team,

I'm trying to add the quantity increment and decrement buttons to the checkout form. (views/cart.php)

I copied the two buttons from show_quantity.php but they don't work.

I added this bit to cart.php as well expecting it to magically start working, but of course it didn't.

$i =$this->params->get('i');
$min_quantity =$this->params->get('min_quantity');
$max_quantity =$this->params->get('max_quantity');
$html =$this->params->get('html');

How far from the truth am I?

One more question - what does the $i variable do?

Kind regards,

Drago.

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
10 years 2 months ago #170591

Hi,

The view "checkout | cart" does not use the view "product | show_quantity" to display the quantity field.
It provides two different "layout", a simple text box or a drop down list.

If you want to extend the features in that view, you will have to add more content and import some elements from the view "show_quantity" into the checkout cart view.
And you will find the content of " params->get('html') " in the HikaShop cart class, at the beginning of the function "displayButton".

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.

  • Posts: 147
  • Thank you received: 6
9 years 6 months ago #200959

Hi, Is there a tutorial on how to do this?
I also would like to add the + - buttons to the checkout products.

I copied the link/buttons from "show_quantity" into the cart/checkout. I also copied the params->get('html') variable from the top of the "show_quantity" and pasted on the top of cart/checkout, but no lucky.
They appear fine but when I click it there is no action. I just takes me to the top of the page. And no effect to the product quantity input field it self.

Thanks

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

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #200976

Hi,

The easiest solution will be to use javascript, onclick on the + or - button in order to update the input field based on its id or via jQuery pointers.

So it require some Javascript / jQuery knowledges.

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

Time to create page: 0.085 seconds
Powered by Kunena Forum