Bulk Add To Cart

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
6 years 7 months ago #291843

-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.7
-- PHP version -- : 7.1.14

I'm going to be starting a project soon which will require me to give Hikashop a new interface allowing registered users to submit a CSV string which will identify 1 to X items to be added to the User's shopping cart (similar in function to Hikashop's Bulk Product Input within the Administrator tools).

Adding a feature like this doesn't seem to be a normal in-Hikashop customization route, so I am guessing that I will need to physically add a new View and a new Controller. Submitting to a page without a Layout value gives me an Access error, and using a layout value overrides the submitted Task value. A little tinkering has shown me that a better understanding of Hikashop's custom Router may provide serious help on this project. Is there any formal documentation or guidance on the Router?

I have inserted a new View folder and templates, and can reach them through a custom browser address ("?option=com_hikashop&view=bulk"), but I haven't managed to create a suitable Menu Item Type option under Hikahsop's list yet.

In this new Controller (extending hikashopController), the standard Joomla method of submitting an action value with the format "controller:taskname" doesn't automatically trigger the class method "taskname", so I am using an IF statement to trigger it, and plan to redirect the browser back to the same page after the submitted CSV text is parsed and items are added to the cart, with confirmation reported via Joomla Messages.

Any other suggestions or moving pieces I should be concerned about? Suggestions?

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
6 years 6 months ago #291853

Hi,

You'll indeed need to have a new view and controller.
The best would be to go through our API.
I would recommend to check on the code of the email history plugin (in plugins/hikashop/email_history).
This plugin adds its own controller and views to HikaShop, even adding a menu element to the backend menu of HikaShop.
So it's a really good starting point.

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

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
6 years 6 months ago #291887

Thank you very much! That sounds precisely like what I will need.

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

Time to create page: 0.056 seconds
Powered by Kunena Forum