Hi,
I'm trying to extend the copy function in the product pages. I've added in a new button and given it the ability to change the form action to:
admin/index.php?route=catalog/product/magiccopy&token=...
I can't for the life of me work out where this routes to though to handle the form though - I'm a bit lost in the structure. I think I can see the routines for copy / delete which work in the same way but I can't see how to put in a new function (called magicCopy) and have it routed to when the form is submitted to the above URL.
I'm experienced with PHP so adding the routine is not an issue, I just need to know where. If anyone could help I'd be really grateful.
Cheers.
Ok so I think I sort of worked it out actually... I added a public function named magiccopy to:
admin/controller/catalog/product.php
which now seems to be responding when I send the form there. Is this correct or have I just fluked this? I can't actually see the bit which is calling this function based on the route, can anyone point me to that - I'd like to understand it rather than just go on regardless
Cheers.
admin/controller/catalog/product.php
which now seems to be responding when I send the form there. Is this correct or have I just fluked this? I can't actually see the bit which is calling this function based on the route, can anyone point me to that - I'd like to understand it rather than just go on regardless

Cheers.
You've got it right, here's the layout:
catalog/product/magicopy
Catalog is the Controller folder (admin/controller/catalog)
Product is the Controller folder (admin/controller/catalog/product)
MagicCopy is the public function (public function magiccopy)
If no function is specified in the route (route=catalog/product), then the index function is called.
Hope this helps.
Regards
catalog/product/magicopy
Catalog is the Controller folder (admin/controller/catalog)
Product is the Controller folder (admin/controller/catalog/product)
MagicCopy is the public function (public function magiccopy)
If no function is specified in the route (route=catalog/product), then the index function is called.
Hope this helps.
Regards
Who is online
Users browsing this forum: No registered users and 6 guests