Hi,
Well, what I would do to do it properly is to create three new tables:
- a "location" table, where you can enter the locations you want to be delivered.
- a "location_vendor" table where you can have basically two columns : a location_id pointing to an entry in your location table and a "vendor_id" pointing to a vendor in the hikamarket_vendor table.
- a product_vendor" table so that you can link vendors to products with two columns: a product_id column pointing to an entry in the hikashop_product table and a vendor_id column pointing to a vendor in the hikamarket_vendor table.
Then, you can develop the plugin.
If you're not familiar with Joomla plugins development, you first want to check:
docs.joomla.org/Portal:Plugin_Development
Then, I would recommend to check the plugins/hikashop/email_history/ folder of your website. That's the "email history" plugin of HikaShop, which adds everything you can find under the Customers>Email history menu in your HikaShop backend.
Using that plugin as a reference, and the developer documentation we have (
www.hikashop.com/support/documentation/6...r-documentation.html
), you can first add the interface in the backend to see a listing of locations, create new locations, delete and edit them.
Then, you can create the interface on the product edition page to add the link to the vendors. You can do so implementing the onProductBlocksDisplay event to add your HTML, and the onAfterProductCreate and onAfterProductUpdate triggers to save the data in the database.
You can also create the interface on the vendor edition page to add the link to the locations. You'll have a onAfterVendorCreate and onAfterVendorUpdate triggers for the saving, and for adding the HTML, I would recommend to directly add it as a view override:
www.hikashop.com/support/documentation/1...-display.html#layout
Then, you can develop a joomla module to add a dropdown for the selection of the location and use the onBeforeProductListingLoad event to filter out the products based on that selection.
And finally, you want the select the vendor based on the location of the products in the cart. You can do that with the event onBeforeProductsVendorAttribution :
www.hikashop.com/support/documentation/1...ctsVendorAttribution
Once the vendor is assigned to the cart thanks to that trigger, HikaMarket will automatically notify the vendor for the order. And you can setup the payment methods in each vendor so that the payment will go to the vendor automatically.