If a product has options!

  • Posts: 49
  • Thank you received: 1
4 years 6 months ago #311418

-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9
-- PHP version -- : 7.2
-- Browser(s) name and version -- : Chrome latest

Hello,

When a product with options added to the cart, can it be editable? Like After I click the link to the product in the cart, to edit the options? The current cart now doesn't save the options for products. It can only be deleted.

I look forward to hearing from you

Thanks

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

  • Posts: 81379
  • Thank you received: 13037
  • MODERATOR
4 years 5 months ago #311433

Hi,

There is no mechanism to edit the products already in the cart.

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

  • Posts: 49
  • Thank you received: 1
4 years 5 months ago #311493

Hi Nicolas,

Thanks for the reply, I was thinking if there is a way to do this through a plugin trigger, do you have any triggers that you think can help with this issue?

I mean maybe it is doable by using onHikashopAfterDisplayView with another trigger, which brings data from the ordered products with it's options. And based on that maybe we can create that plugin if the product I am visiting matches any of the IDs of the products in the cart, should be in an editing mode, and shouldn't be added to the cart, but instead should be updated.

Please let me know what do you think?

Thanks

Last edit: 4 years 5 months ago by onereik.

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

  • Posts: 81379
  • Thank you received: 13037
  • MODERATOR
4 years 5 months ago #311496

Hi,

Well, it would be possible to add that capability with a plugin yes. However, the way I see it, it's not simple. It would require developping a specific interface to be able to modify the product elements in the cart (to handle characteristics, options, custom item fields, etc).
As a custom development, it would be much simpler to just handle the options, but it would still be some work. You would still need to develop a view to have the options selection interface (in a popup which would be called when clicking on an edit icon next to the product name in the cart view for example), and you would also have to handle the saving to update the product in the cart as the update functions already available are not meant to be able to modify the options of products already in the cart.

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

  • Posts: 49
  • Thank you received: 1
4 years 5 months ago #311514

Hi Nicolas,

Well, the first thing that came to my mind is developing a new view as you just said in your comment, however, I knew that it will require more work as developing new functionalities for the update in the model and controller, and these customizations will be lost once I install new updates for Hikashop, so that's why I asked if it is possible to do it by using a plugin.

I think this is an important option to have. Because sometimes users who buy things want to make an update to the things they bought rather than deleting the product and re-adding it to the cart with the new options they want.

What do you think?

Thanks

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

  • Posts: 81379
  • Thank you received: 13037
  • MODERATOR
4 years 5 months ago #311517

Hi,

With HikaShop, it's possible to develop new views, controllers, models, through plugins. You can see an example of that with the email history plugin. The files of the plugin are in the folder plugins/hikashop/email_history/
And the plugin adds itself to HikaShop via triggers to add its on menu Customers>Email history in the backend as well as the views and controller necessary to handle all its functions. By doing a plugin in a similar way, you could have this new capability without having to modify directly the core of HikaShop and thus be able to update your HikaShop in the future without loosing your code each time.

Indeed, being able to edit the products directly in the cart is a cool feature we could add. It's just not easy to add as there are many things to take into account.

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

  • Posts: 1119
  • Thank you received: 114
4 years 5 months ago #311556

nicolas wrote:
Indeed, being able to edit the products directly in the cart is a cool feature we could add. It's just not easy to add as there are many things to take into account.


+1

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

Time to create page: 0.075 seconds
Powered by Kunena Forum