Jump to content

Recommended Posts

Posted

Hi everyone! @kongondo I’ve been really enjoying testing PWCommerce and exploring its features. I'm currently digging into hookable methods, especially around extending things like the custom checkout customer form. I've reviewed Demo 2, Demo 3, and the hook documentation, and also tried several example hooks shared in the forums, always keeping in mind the transition from Padloper to PWCommerce. That said, I haven’t been able to get any of those hooks to actually trigger, not even a simple log entry. I suspect this might be due to class or method name changes under the hood, but I'm not entirely sure. Does anyone know if there is an up-to-date way to inspect which classes and hookable methods are currently available in PWCommerce? A class map, autoload overview, or even a debugging tip would be super helpful! Thanks in advance!

  • Like 1
Posted

Hi @marie.mdna,

I've split your question into its own topic as the other thread is specifically for 'me requesting' help 😁.

Thanks for the various tests and also the issues you have reported. I am not ignoring them. I just haven't found the time. GitHub did not inform me about them either, which delayed things further.

Back on topic, @bernhard's Deepwiki mentioned here looks useful.

Alternatively, if you open the module folder in an IDE like VS Code, you can simply search the whole folder for 

___

i.e., 3 underscores. Old school/manual but it works. You can then open that in the 'find/search editor' in VS Code. For some reason I thought I had listed all the hookable methods in the docs; looks like I didn't.

5 hours ago, marie.mdna said:

That said, I haven’t been able to get any of those hooks to actually trigger, not even a simple log entry.

Could you please share some example code you have tried + tell us where you are calling the hooks.

5 hours ago, marie.mdna said:

especially around extending things like the custom checkout customer form. 

Maybe I have misunderstood this one. The whole idea with a custom checkout customer form is that you can create your own; Extending the one in the demo examples is not required. I think perhaps you meant to say you need hooks in order to handle inputs in your custom checkout form 😃.

Posted

Hi @kongondo!

Thanks for this new topic, it might indeed be easier!

3 hours ago, kongondo said:

Thanks for the various tests and also the issues you have reported. I am not ignoring them. I just haven't found the time. GitHub did not inform me about them either, which delayed things further.

No worries, please take your time to go through them, I admit not being the most familiar with module building so this also comes as a learning experience 🙂

3 hours ago, kongondo said:

Back on topic, @bernhard's Deepwiki mentioned here looks useful.

I'll be getting a good look at it, thanks @bernhard

 

3 hours ago, kongondo said:

Could you please share some example code you have tried + tell us where you are calling the hooks.

I've been adding hooks in /site/ready.php, but as soon as I posted a message I got some progress! It turns out that I naively expected "Padloper" parts to simply be replaced by "PwCommerce" and then searched for more documentation 😅

//Original Padloper
$this->addHookAfter('PadloperProcessOrder::checkCustomOrderCustomerFormForErrors', null, 'customCheckCustomOrderCustomerFormForErrors');
//Expected edit
$this->addHookAfter('PwCommerceProcessOrder::checkCustomOrderCustomerFormForErrors', null, 'customCheckCustomOrderCustomerFormForErrors');
//Actual hook
$this->addHookAfter('PwCommerce::checkCustomOrderCustomerFormForErrors', null, 'customCheckCustomOrderCustomerFormForErrors');

 

3 hours ago, kongondo said:

Maybe I have misunderstood this one. The whole idea with a custom checkout customer form is that you can create your own; Extending the one in the demo examples is not required. I think perhaps you meant to say you need hooks in order to handle inputs in your custom checkout form 😃.

Exactly 😉 this is why I didn't offer my help on writing the documentation...yet!

  • Like 1
Posted

Hey @marie.mdna,

Cool; glad you got this sorted! 

12 minutes ago, marie.mdna said:

but as soon as I posted a message I got some progress! It turns out that I naively expected "Padloper" parts to simply be replaced by "PwCommerce" and then searched for more documentation 😅

Yes; Hooking got breaking changes in Padloper version 010 which you found out about. For others reading this, please see this topic:

Just curious, are you testing on a multi-lingual site? If yes, is Dutch the main language on the site? I ask because previously, bugs have been reported on such sites. For instance, with respect to creating product variants. Hopefully I fixed them all. Otherwise, please continue filing bugs if you can. Thanks!

Posted

Amazing! This is probably the topic I've been missing 

I'm not testing on multi-lingual at the moment, but that will definitely be something I'd have to test then as I am based in the Netherlands 🙂 Also, I haven't mentioned it, but you've done an incredible work, I already feel I've learned a lot!

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...