I have developed a virtual store using virtuemart 2.0.10 and I need the products in a given category have a different flow of purchase.
Is there a way, from the data of an existing product (with name, price, description, etc.) to create a new product with new id and sku, using an image located in a known directory? All done on the front end, as user interaction, using classes of MVC framework of virtuemart 2.
Needs to be done this way for the product to be added to cart separately, even though the same product base, each with its resized image, and when you click it to open the product details displaying a custom image.
If anyone know a way to do, please help! I looked at the classes responsible for registering products in virtuemart but do not know how to do safely from the front-end.
The first step (redirect user to component and create a custom image) is already done and working, the image is saved in directory and its url recorded in session
Take a look at the VirtuemartControllerProduct::CloneProduct
function. It will point you down into the VirtueMartModelProduct::createClone
function where the work actually goes down.