Coding question.

Open to all! Ask other shopowners for help.
Post Reply
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Coding question.

Post by Dan Cole »

I'm updating a bit of code I use for copying products and noticed this code in one of the catalog actions.

Code: Select all

$admin_hooks->call('categories', 'preDuplicateCopyToConfirmAction', $parameters);
I did a search on github but I can't seem to find any other references to it or what is might be used for so I'm wondering if someone might be able to point me in the right direction or give me a brief explanation as what it might be used for? I'm curious.

Dan


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Coding question.

Post by burt »

This would be used by a Hook, at the point of confirming when duplicating a product.

EG if shopowner was duplicating a product the shopowner could write a hook to set product_quantity to 1000 instead of (say) duplicating the qty of the prodcut being duplicated.

Shiny Red Apples: 4 in stock
Even Shinier Redder Apples (the dupe): 1000 in stock
I am not here to build for you.
I am here to build with you. Let's help each other.
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Coding question.

Post by Dan Cole »

burt wrote: Sun Dec 15, 2024 4:14 pm This would be used by a Hook, at the point of confirming when duplicating a product.

EG if shopowner was duplicating a product the shopowner could write a hook to set product_quantity to 1000 instead of (say) duplicating the qty of the prodcut being duplicated.

Shiny Red Apples: 4 in stock
Even Shinier Redder Apples (the dupe): 1000 in stock
Ahhh...thanks Gary....I guess it is not in use but could be....I get it. I appreciate it.

Dan
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Coding question.

Post by ecartz »

You would need it if you had custom columns in the product. As is, it copies the columns for a core product. If you add custom columns, it won't know to copy those. You'd need to add them to the things to be copied.
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Coding question.

Post by Dan Cole »

ecartz wrote: Sun Dec 15, 2024 5:33 pm You would need it if you had custom columns in the product. As is, it copies the columns for a core product. If you add custom columns, it won't know to copy those. You'd need to add them to the things to be copied.
Thanks Matt....I understand and appreciate the explanation. I do have extra columns so I might give that a try. As I update my existing site and dig deeper into the code, I'm totally amazed at the work you guys have done. Awesome stuff.

Dan


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply