Store Name in Magento email template - php

I'm using the following code to get store name in a reminder email sent by admin.
$storeName = Mage::getModel('sales/order')->getStore()->getName();
However since the email is sent via the admin the store name is coming up as Admin and not Widgets.com.
How do I get it to insert the Store Name?

Try this:
$store = Mage::app()->getStore();
$storeName = $store->getName();

If you still have access to the quote (during order creation)
Mage::getSingleton('adminhtml/session_quote')->getStore()->getName();
To get the store name by order store id
Mage::app()->getStore($order->getStoreId())->getName());

Related

sugarcrm how to get the current contact name

Im having a problem showing the current viewed contact name in SUGARCRM
can anyone tell me how to get the current contact name, lets say i am browsing a contact in SUGARCRM called jhon i need a PHP piece of code to get this name and store it in a variable.
I already tried this:
global $current_user; echo $current_user->user_name;
but not that is what i am looking for, I am looking for something like this to be able to get the current contact name.
Try to access the full_name property. $current_user is an instance of User bean
$current_user->full_name
If not working try to retrieve user details using bean id of current user :
$user = new User(); //user object
$user->retrieve($current_user->id); //retrieve user data
$full_name = $user->full_name; // If have full name property.
If no full name property try to concatenate last name and first name
$fullname = $user->first_name .' '. $user->last_name;
If you're on a contact record, then the .tpl file needs to have the property name of what you want to show. Your question says name, so try putting this in the file where you want it:
"{$fields.first_name.value} {$fields.last_name.value}"

Get user email addresses in mediawiki

How can I retrieve an array of email addresses from MediaWiki in php?
The reason is that I want to modify the BlockAndNuke extension so that it shows the user's email address, and not just the username, at the special page Special:BlockAndNuke.
The method is called $user->getEmail();. Where you get the user object from, depends on how the extensions looks. If you intend to modify special page of the BlockAndNuke extension, you would end up with something like
/* First create a user object for this user name */
$user = User::newFromName( $name );
/* Then ask for the users email address*/
$emailAddress = $user->getEmail();
You can also create a User object from an id: $user = User::newFromId( $id )

OpenCart How to get store details to controller

I can track customer data using
$this->customer->getFirstName();
$this->customer->getLastName();
$this->customer->getEmail();
this way,and is there any similar way to track store data like email, store name
eg: like this $this->store->getEmail(); (this is not working)
Use the following:
$this->config->get('config_name'); // store name
$this->config->get('config_title'); // store title
$this->config->get('config_owner'); // store owner name
$this->config->get('config_email'); // store email

How can I define a variable in the PHP header ('Location:)

I'm trying to redirect to another page when a record is added to the database.
I want to make sure that this instruction creates an address which contains the id number.
header('Location:inventory_issue_view.php?filterer_client_name=<%%URLVALUE(suiting_reference_no)%%>');
However the address I get from this is
inventory_issue_view.php?filterer_client_name=<%%URLVALUE(suiting_reference_no)%%>
I know the value of
<%%URLVALUE(suiting_reference_no)%%>
is correct since if I edit the instruction to this:
header('Location:inventory_issue_view.php?filterer_client_name=7499');
I get the correct address.
Using this code:
$client=sqlValue("SELECT suiting_reference_no FROM client_suiting WHERE client_name = '{$data['client_name']}'");
I get a null value for $client
Using this code:
$client=sprintf("SELECT suiting_reference_no FROM client_suiting WHERE client_name = '{$data['client_name']}'");
$client=SELECT%20suiting_reference_no%20FROM%20client_suiting%20WHERE%20client_name%20=%20%277489%27
This part of a hook after insert in an APPGini generated script.
An associative array where the keys are field names and the values are the field data values that were inserted into the new record.
* For this table, the array items are:
* $data['issue_date'], $data['client_name'], $data['suiting_ref'], $data['inventory_item'], $data['inventory_qty'], $data['inventory_item_size'], $data['inventory_size_category'], $data['inventory_cost'], $data['inventory_value']
Now that I look at it again an easy solution would be if $client= $data['suiting_ref'] or however one should compose it.
*
How do you get the id of the client? From a query or a form? Hovewer, try:
header("Location:inventory_issue_view.php?filterer_client_name=$clientId");
where $clientId is a variable containing the number.
try this
header("Location:inventory_issue_view.php?filterer_client_name=".$clientId.");
or
header("Location:inventory_issue_view.php?filterer_client_name=$clientId");

How do i set email as username in Joomla 1.7

I'm using joomla 1.7 and I want for some users to not have the option to insert a username.
I'm trying to set that on registration (for said users) the system will save the inputted email in the username field and the email field, and remove the username textbox from the form.
I know i need to insert $data['username'] = $data['email'] somewhere but I cant find the right place.
I tried to put it like this in the registration model under public function register($temp) with no success. I can't find another logical place to put it.
// Prepare the data for the user object.
$data['my_teacher'] = $data['my_teacher'];
$data['email'] = $data['email1'];
$data['username'] = $data['email1'];
$data['password'] = $data['password1'];
$useractivation = $params->get('useractivation');
i found a way to do this
just add
if(isset($temp['email1'])){
$temp['username'] = $temp['email1'];
}
right under
$temp = (array)$app->getUserState('com_users.registration.data', array());
in the module file and then remove the "username" fiels from the .xml and add a hidden field named:jform[username] and id:jform_username in the default.php file in the views/registration/tmpl
the line looks like this
<input type="text" name="jform[username]" id="jform_username" value="<?php echo 'something.random.that.will.be.replaced.with.the.email'; ?>" style="visibility:hidden;">
all the files that i am talking about are under /components/com_users/
it should work...
http://extensions.joomla.org/extensions/access-a-security/authentication/10343
The above extension will remove the need for users to enter a username on registration. However it generates a username based on the name field. It uses the email address as the username only as a last resort, because this can cause problems with certain extensions in Joomla. It also allows users to login with their email address.
Dylan

Categories