Skip to main content

Problem finding UpdateCart function for checkout cart.

More
9 years 7 months ago - 9 years 7 months ago #262461 by gioferrario@gmail.com
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.5

Good day, I have a problem removing items in the checkout cart of Hikashop (version 2.6.3).
I know that my version is not tle latest, but every other thing is working so I wanted to fix this before editing again everything.
A Little intro:
In my site I sell bike races photos, so I have done some modifications that allow the user to buy all his photos in one click, with a fixed price.
The result is a cart with an item with a price > than 0€ and the single photos (connected to the previous item) with 0€ value.
My aim is to delete all 0€ value items when I delete (from cart) the parent item.

In the module cart (/com_hikashop/views/product/tmpl/cart.php) everything is working. I edited the function updateCart in /com_hikashop/controllers/product.php, now it updates not only a single product but an array of products.

The problem is in the checkout cart: /com_hikashop/views/checkout/tmpl/cart.php.
The remove button, only removes the main item and not the children.
From the url of the button I noticed that it operates on product_ids and not on cart_product_ids like the module cart. I double checked the function updateCart and my modification is also reproduced for product ids.

I am using firebug to debug my code, and the logs never print when I fire the button in checkout cart, while it works when I use module button.
I also noticed that if I delete the function updateCart (with some items already in the cart) in /com_hikashop/controllers/product.php the module cart stops working, but checkout cart still works.

The problem seems to be that I have edited the wrong function and there must be another updateCart () somewhere, but I cannot find it.
I tried searching the function updatecart in all the files of the hickashop component folder, but the only one is in product.php.
Is there another place in which I have to reproduce my modifications?

Thank you very much for your help, I hope my explanation is clear enough, I am not a good php developer I do it mainly for fun.
Last edit: 9 years 7 months ago by gioferrario@gmail.com.

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

More
9 years 7 months ago #262469 by Jerome
Hi,

Why not putting the other products as "options" of the main one ?
Thanks to the setting "group options" in HikaShop you will then let the core manage the link between the product and his options.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

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

More
9 years 7 months ago #262537 by gioferrario@gmail.com
Thank you for your answer,
maily because I have already thousand of photos. The offer package is a recent need and I don't want to reload everithing if possible.
By the way, using options I have to create a specific parent product for each racer. With my changes the customer can buy everything that appear after filtering the race on the base of his number.
You gave me a good starting point, I will check how the option removal works, thank you!

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

Time to create page: 0.136 seconds
Powered by Kunena Forum