Post by schlimig » Wed Jun 06, 2012 8:07 am

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.

Newbie

Posts

Joined
Wed Jun 06, 2012 7:59 am

Post by schlimig » Wed Jun 06, 2012 8:35 am

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.

Newbie

Posts

Joined
Wed Jun 06, 2012 7:59 am

Post by WebEngage » Sun Jun 10, 2012 3:52 pm

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

Newbie

Posts

Joined
Mon Jun 04, 2012 9:18 pm

Post by schlimig » Mon Jun 11, 2012 1:09 am

Thanks for taking the time to reply, it's good to know I'm on the right track :)

Cheers!

Newbie

Posts

Joined
Wed Jun 06, 2012 7:59 am
Who is online

Users browsing this forum: No registered users and 3 guests