Can I have hooks in a Joomla component? How? - joomla

I need to add a hook in onUserAfterDelete to when the admin deletes an user his customer info (managed by my component) goes away too.
How can I do that? Where I put the function?
Thanks a lot!

Basically you need to create a plugin, which will be independent of the component itself.
You need:
manifest file
plugin itself as a .php file - here you will implement the method onUserAfterDelete.
Some code to start with is already in another related answer.

Related

Override JE Quick Contact module in Joomla 3x

My client is using the module Je Quick Contact in their site, in Joomla 3.7.3
As default, the sender email is user's one, but in that way sometimes email goes in spams.
We would like to change it to have a generic send contact#domain.fr, seems we can't handle it in Back-office.
So I tried to override the module to change the sender email.
The module was in modules/mod_je_quickcontact and there there is files mod_je_quickcontact.php, index.html, mod_je_quickcontact.xml and folder CSS, JavaScript, PHP, images
In my template I created a folder mod_je_quickcontact and I put there all thoses elements, and I changed the file mod_je_quickcontact.php
But it's not working, it's still default data which are displayed.
I looked at Internet to see how to override, but for all example I found, in default module there is tmpl/default.php file to override. I don't have such folder and file.
Maybe I missed something or I did it wrong... I don't know what to do know, so, if someone has an idea, it would be great!
I think in Joomla there is only a way to override a template or layout of modules. The module you used is not best practice, because there are not using a default template (tmpl/default.php) to display the output of the module.
Like in Joomla docs mentioned:
The directory structure you need is: TEMPLATE_NAME/html/EXTENSION_NAME/VIEW_NAME/FILE_NAME.php
(Source: Joomla override documentation)
What I would do: Copy the module, change it in the way you need it. That´s it.
There have to be a difference between paid and free modules :-P

Magento custome module translation not working

For a specific module translation is not working for any of it's action. Even if i add the translation in the translate.csv file. And one more thing when i access that module actions then in Chrome translate option is also not showing.
Please help me. I really need help for it. Thank you
If the translation file is correct and loaded it most probably comes along with your caching policy. Is the cache emptied ? Do you have varnish or any other similar cache system ? If yes, you need to flush it too.
If things are still not working, please provide more information.
I have solved the issue. Actually i have override the customer account controller. To resolve the Ddos attach. I override the parent class predispatch function but not calling the parent predispatch from child class.

virtuemart hook for custom thankyou page

Hey i need to develop a custom plugin for custom thankyou page in VirtueMart
How should i achieve that , because thank you page is generated according to the payment selected.
What is the correct hook for changing the last thank you page in VirtueMart.
I tried plgVmConfirmedOrder but is that the correct hook? how to achieve this thing using virtuemart hook system?
You don't need to create a plugin for custom thankyou page. You just go and modify or override the template file order_done.php at the location given below-
components/com_virtuemart/views/cart/tmpl/order_done.php

how do i remove registration link in joomla 3.2 - login module

i need to remove the registration link inside the login view http://bartenders4hire.net/index.php/login without completely disabling the registration functionality.
We are using js Jobs on the site and the regular registration is not providing all fields, therefore i need to find the code where i simply can delete the registration link.
I looked inside the modules and plugins, but couldn't find it
Anyone has an idea where i can find that code?
You'll find the registration-link in /components/com_users/views/login/tmpl/default_login.php on the bottom of the file. You can override this file in your own template by copying it to /templates/yourtemplate/html/com_users/login/default_login.php. Then you can remove the registration-line from the file in your template,
regards Jonas

Understanding the Joomla Component File Structure / from URL

I'm new to joomla and have got a problem with a website.
I need to modify a view and I've been told it is in
http://www.example.com/index.php?option=com_user&view=register&Itemid=68
It has a registration form and i need to modify its field. I've access to FTP only. I need to know where are these files to modify the registration form. If one can describe the meaning of this url structure then it would be very helpful.
You will find the template files in /components/com_user/views/register/tmpl.
However, you should create an html/com_user folder in your template directory with a copy of those files and use a template override ("never" edit core files).
Here are a couple resources that will point you in the right direction:
http://docs.joomla.org/J2.5:Developing_a_MVC_Component/Introduction
http://docs.joomla.org/How_to_override_the_component_mvc_from_the_Joomla!_core
com_user means use the user component register view.
Itemid 68 refers to the id of the menu item it is linked from.
You don't want to directly modify any joomla files.
If you want to add a field to registration activate the user plugin or create your own user plugin along the same design but with the fields you want.
It is advisable not to modify the core files directly, they will get overridden whenever the Joomla is updated.
However what you are looking for is available at components\com_users\models\forms\registration.xml file. you can change the default fields of the registration form in this file.
If you would like to add additional fields to registration form, there is a better way:
http://docs.joomla.org/Creating_a_profile_plugin

Resources