Hello,
I am looking for a way to associate an existing product to a shop. I am developing a module that groups products into catalogs and then allows you to assign these catalogs to shops. When you assign a catalog to a shop it will get the list of products belonging to that catalog and then associate those products to the shop if that shop doesn't have an entry for the product already. I am having some issues with the actual associations. At first I thought I might be able to use the associateTo() method to accomplish this.
Example:
$product = new Product($id_product);
$product->associateTo($shop->id);
This sets up an entry in the product_shop table for the association, however that's all it does just a simple association. None of the other product data is duplicated. I've been pouring through the source but I have yet to be able to find any methods in either the product or the shop classes that would facilitate associating an existing product to a shop.
I'm hoping that someone has run into this and could point me in the proper direction. With all the multishop work one would think that there would be a builtin method somewhere to easily associate a product to a new shop.
Thanks!