Joomla! Unable to edit modules PHP codes - php

I'm quite new to Joomla! as well as PHP.
Currently i'm developing a Joomla! site using Joomla! Version 1.5.14.
I have downloaded and installed VirtueMart 1.1.3 on my site and now i want to edit the registration fields for the VirtueMart Module.
I went to C:\xampp\htdocs\mysite\modules\mod_virtuemart and opened up the mod_virtuemart PHP script.
I only see these codes for the registration part:
<?php endif; ?>
<?php if( $mosConfig_allowUserRegistration == '1' ) : ?>
<tr>
<td colspan="2">
<?php echo $VM_LANG->_('NO_ACCOUNT'); ?>
<a href="<?php $sess->purl( SECUREURL.'index.php?option=com_virtuemart&page=mysite.registration' ); ?>">
<?php echo $VM_LANG->_('CREATE_ACCOUNT'); ?>
</a>
</td>
</tr>
<?php endif; ?>
But i'm unable to find the few lines of codes for the registration fields (For the user to key in).
Examples: Email, company name, title, first name, last name, etc... (with the text boxes beside them)
Hope you get what i mean.
Now i want to add in some more fields for registration, such as 'Position in company', etc..
Can anyone tell me specifically where to find those codes so that i can edit them?

As per my knowledge you should do it from admin panel. Joomla provide custom settings of fields for virtuemart user registration.
You also can refer below link for that.
http://virtuemart.net/documentation/User_Manual/User_Registration_Fields.html
I think this would be helpful to you.
Let me know if anything new you get.
Thanks.

Related

Show or Hide content user role wise

I'm developing a website in wordpress using Woocommerce and WC Vendor Marketplace plugin. I want to show content on certain page user role wise in wordpress website.
For example.
If i'm login as a vendor then it shows content "A" and if i'm login as a customer then it hides content "A".
Here i'm customize my own code for this but not work.
<?php
$userss =get_user_meta( $vendor_id, 'wp_capabilities', true );
if ($userss='vendor') {
echo'<li id="menuuu">Back To Dashboard';
echo'</li>';
}
?>
<?php endif; ?>
In above code 'wp_capabilities' is for user role in wordpress. In my code, user roles are 'vendor' and 'customer'. I'm really weak in php. So please help me.
In wp_capabilities data store as serilized array of user role instead of this you can use current_user_can for more information you can refer to this.
You can change your code as below:
if (current_user_can('vendor')) {
echo'<li id="menuuu">Back To Dashboard';
echo'</li>';
}
?>
<?php endif; ?>
I know this has been marked answered, however using current_user_can() with roles is unreliable and even says as much in the codex.
While checking against particular roles in place of a capability is supported in part, this practice is discouraged as it may produce unreliable results.
It's better to use our built in methods to determine if the current user is a vendor.
<?php if ( WCV_Vendors::is_vendor( $vendor_id ) ) : ?>
<li id="menuuu">Back To Dashboard</li>
<?php endif; ?>

Wordpress: How to redirect when trying to access a site without permissions

I'm building a community-website with wordpress 4.8 and bbPress Version 2.5.12 installed. I also installed a plugin called Paid Memberships Pro (and an extension that's made for bbPress) that handles the permissions in my forum.
What I would like to add is a redirect to a page on my site which is happening in the moment somebody without the permissions clicks on the member-area. The page that will open will speak about the benefits of joining.
Wordpress itself and the member plugin both only allow me to insert a text that is displayed in case somebody without the permissions try to enter the member-area. This text is small and doesn't contain enough information and I rather prefer to redirect to another page.
I have two problems with this.
First I am not sure if I rather change this in the wordpress settings or the plugin settings. Right now the plugin overrides the settings of wordpress (meaning if I have two different texts in wordpress and the plugin it picks the text from the plugin). So I could change it in the plugin or I change it in wordpress but have to simultaneously tell wordpress to read it's own file instead of the one in the plugins directory (I would say it makes more sense to change it in the plugin but I wanted to make sure).
Second I don't know how to change this code so that it's actually redirecting. I only got as far as breaking the site or nothing at all is happening.
If I go to the file feedback-no-access.php in the bbpress-folder it includes the following code:
<?php
/**
* No Access Feedback Part
*
* #package bbPress
* #subpackage Theme
*/
?>
<div id="forum-private" class="bbp-forum-content">
<h1 class="entry-title"><?php _e( 'Private', 'bbpress' ); ?></h1>
<div class="entry-content">
<div class="bbp-template-notice info">
<p><?php _e( 'You do not have permission to view this forum.',
'bbpress' ); ?></p>
</div>
</div>
</div><!-- #forum-private -->
In the members-plugin I find the following lines:
/**
* Error Message Option
*/
function pmprobb_option_error_message() {
$options = pmprobb_getOptions();
if(isset($options['error_message']))
$error_message = $options['error_message'];
else
$error_message = "";
?>
<input id='pmprobb_option_error_message' name='pmprobb_option_error_message' size='40' type='text' value='<?php echo esc_attr($error_message);?>' />
<small>This message is shown when users attempt to view a forum or thread they don't have access to.</small>
<?php
}
I tried to edit this second block of code so that it's not searching for this message but redirecting to an url I want to point to. But nothing really worked out and I hope that somebody can help me out with that! Thank you
I could solve it by myself without changing the code (which wasn't really possible for me as I don't have enough knowledge).
I found a plugin called redirection and it works perfectly fine. Whenever I click on a forum that I have no access to it redirects me to the page I want it to go to. I don't know if this is a good practice but it works perfectly fine!

Can I give my own custom link to some categories in wp - ecommerce?

I am using Mazine template demo which is using wp-ecommerce plugin, In my website I have setup left Categories and Brands widgets, What I need is to link some of categories/Brands to link to my own custom URLs instead of opening category page.
Can I do that? Which specific file I need to change to achieve this?
Thanks
At last got the solution,
Just Edit wpsc-category_widget.php file under Mazine folder , and added some conditions to change the link of some of categories.
<?php if($ti_curr_cat['name']=="Category Name"){ ?>
<?php echo $ti_curr_cat['name']; ?>
<?php }else{?>
<?php echo $ti_curr_cat['name']; ?>
<?php }?>
I've been using http://ecommerceshoppingcart4u.com to build an ecommerce site. It only involves a one off payment which is very cheap. The price is £267

Magento Track shipment link on order view page not showing

I am unable to get the link to show up on admin end! My client is very irked by it missing. Any ideas?
The file adminhtml/default/default/template/sales/order/view/tab/info.phtml has the following code:
<?php if ($_order->getTracksCollection()->count()) : ?>
<?php echo $this->__('Track Order') ?>
<br/>
<?php endif; ?>
adminhtml/default/your_template_name/template/sales/order/view/tab/info.phtml‌​ also has the same code.
I found out that the program formerly written by another programmer was not uploading the tracking numbers from the warehouse to the correct location in admin. It was adding it to the comments but not to the Shipment section. Once I fixed some code in the program to add the tracking numbers, all issues related were solved. Feel free to contact me if you need some help.

create custom fileds in Article Manager of joomla 1.5

I am beginner in joomla so For some customization in joomla's core files i am getting troubles.
what i want:- I want to add check box in article detail page.by using this option i will get the value that the current article should be "Latest or not".
what i done:-i added the extra 1 field of Boolean type in jos_content. and create a check box on article edit form.i create the check box in following code administrator/components/com_content/admin.content.html.php
<td>
<label>
<?php echo JText::_( 'Latest News' ); ?>
</label>
</td>
<td>
<?php echo $lists['latestnews']; ?>
</td>
My Question:- how can i add this field value and update in database?
i found to create such things for joomla 1.6,1.7.but the file structure of joomla 1.5 is very different to other versions.
Please help me out..Thanks in advance.
You need to edit controler and tables which saves the data into database names must be something with article!

Categories