This may be very confusing, but I will try to explain it the best I can
Basically, I duplicated the Shop/Product Module wanting to lean how it works. And I was able to see how everything flows together...except for one part:
Uploading Images and Files. I can select the file, and I can see the progress bar uploading, but once done - it does not apply to the Product Images. No images shows up.
I narrowed the problem down to this code in the Shop_Product model:
public $has_many = array(
'images'=>array('class_name'=>'Db_File',
'foreign_key'=>'master_object_id',
'conditions'=>"master_object_class='Shop_Product' and field='images'",
'order'=>'sort_order, id', 'delete'=>true),
Basically, the condition master_object_class='Shop_Product' has to be the same as the model name, in my case master_object_class='Properties_Listing'
When I change the master_object_class to Properties_Listing, the image loads and shows. But when I save the newly created product, the Product does not actually show any images or thumbnails... basically it just saves the images in the backend, and there is no way for me to reference it as a Product Thumbnail or Product Image in the front end.
The replicated module has:
public $has_many = array(
'images'=>array('class_name'=>'Db_File',
'foreign_key'=>'master_object_id',
'conditions'=>"master_object_class='Properties_Listing' and field='images'",
'order'=>'sort_order, id', 'delete'=>true),
So it got me thinking, for the Property_Listings Module is there a way I can reference the new master_object_class='Properties_Listing' and point it back to master_object_class='Shop_Product'?
Thanks!
Beats

Help













