virtumart in joomla - php

I have made a site site in joomla & in this i use Virtuemart.
In virtumart when user purchse the item then there is a thank page. In this thank page i want to add one module which contain text so that user can change it later. But i am not be able to show it on thanks page. I want to show this module in thanks page data means in between the data not at bottom of thanks page.means in between the lines of thanks page. how can i include my custom module in thanks page of virtuemart.

You need to do some programming for something like this...
Check this out http://docs.joomla.org/JModuleHelper/renderModule
You can install JUMI, modify the Thank You article and add following php script to the article:
jimport( 'joomla.application.module.helper' );
$module = JModuleHelper::getModule( 'yourmodule', 'You Module Title' );
$attribs['style'] = 'xhtml'; // this is optional, if set template XHTML style will be used
echo JModuleHelper::renderModule( $module, $attribs );

Related

Joomla module visible in article but not in category

I have a problem with Joomla!. Is there a way to set a module visible in certain category but not in the articles? (so it will display on the category page, but not in the articles of that category or in subcategories)
I had the oposite problem on previous works and fixed it with some cat id's and php in the index.php, but I don't know how to achieve this effect, is someone there that had the same problem and fixed it?
Regards
create a override of the category view in template/your_template/html/ folder and use the following code inside the override file :
<?php
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('modules');
$position = "YOURPOSITIONNAME";
$options = array('style' => 'raw');
echo $renderer->render($position, $options, null);
?>
Is this useful ?
I don't develop on Joomla, but i found this link.
http://www.inmotionhosting.com/support/edu/joomla-25/extensions/modules-on-homepage
Why not use Advanced Module Manager which has several advanced options that will suit your requirement https://www.regularlabs.com/extensions/advancedmodulemanager#free-vs-pro .

WP Jetpack publicize insert default text(s)

How can I place a default text (hashtag) in the Custom Message?
The textarea is (located in line 643) under jetpack/modules/publicize/ui.php
I tried to put the text in front of $title in various ways, like:
<?php echo "#myhashtag $title"; ?>
or
<?php echo '#myhashtag '.$title; ?>
but it just echoes the text, not the $title.
Any ideas will be greatly appreciated.
You can use the approach of this Wordpress plugin i made (Publicize With Hashtags), which does exactly that. It basically use and action trigger bound to the 'save_post' native event.
If you want to develop your own one you can have a look at my Source Code on the project's GitHub page or in this installation & usage guide I wrote about it.
You can add a filter, like so, to your theme's functions.php or a site-specific plugin:
add_filter( 'wpas_default_prefix', 'add_default_publicize_hashtag_prefix', 10, 4 );
function add_default_publicize_hashtag_prefix() {
$default_tags = '#yourhastaghere ';
return $default_tags;
}
This will add your default hashtag before your title without you needing to hack the WordPress core.
jetpack/modules/publicize/ui.php itself states in its comments:
/**
* Only user facing pieces of Publicize are found here.
*/
You added your hashtag in the textarea which allows admins to enter a custom message (click edit and it will slide down with your hashtag).
As #Yazmin mentioned, the best way to permanently edit the message is using a filter. The filters available are wpas_default_prefix, wpas_default_message, and wpas_default_suffix.
Personally, I had no success using these filters and I'm interested in a working solution to this issue myself.

Custom Taxonomy Term page in Drupal 7

I'm trying to make a custom Taxonomy Term page in Drupal 7. I've created a page--taxonomy.tpl.php file in my templates folder. The file only prints out a message. I now try to force the template file by adding
function template_preprocess_page($variables) {
if (arg(0) == 'taxonomy') {
$variables['template_file'] = 'page--taxonomy-tpl';
}
}
in my template.php, but it won't work. Can you help me? And if I get the custom page working, how do I fetch the nodes with this term (in page--taxonomy.tpl.php)? Thanks in advance.
Try using this in your template.php:
function template_preprocess_page(&$variables) {
if (arg(0) == 'taxonomy') {
$variables['theme_hook_suggestions'][] = 'page__taxonomy';
}
}
You need to pass $variables by reference, so add a & before it
template_file has changed to theme_hook_suggestions in Drupal 7
You don't need the -tpl in the template suggestion unless you want it to be a part of the filename like "page--taxonomy-tpl.tpl.php" which I don't think is what you want.
For more information, check out template_preprocess_page(), theme_get_suggestions() and Working with template suggestions
Not sure if this would meet your requirements, but one of default D7 views - Taxonomy term - emulates Drupal core's handling of taxonomy/term pages. You could just enable it (it would automatically replace Drupal's core taxonomy URLs), and then do whatever you want with it, keeping original page structure, all blocks etc, using Views' page templates (see "Theming information" in "Advanced") and all other bells and whistles...
Since you are using Drupal 7, you could also create a file name "taxnomy-term.tpl.php" and edit according to your needs.
See taxonomy-term.tpl.php
Full control over the taxonomy term page can be obtained using hook_menu_alter() . See https://drupal.stackexchange.com/questions/48420/theming-and-overriding-taxonomy-term-vocabulary-page/111194#111194

wordpress custom script to handle link!

in wordpress the single page is controlled by single.php theme file. I want to put another link on the single page like "Preview". I want this link to be handled by preview.php. preview.php will be stored in theme directory! how to handle this?
usually I do these using init action hook! if the variable exists in the query string, I perform the action! but how to register a custom script to handle a custom link!
the single page link is like ?p=x and the link to preview will be ?p=x&action=preview
thanks in advance
You could do it old school style. At the very top of your single.php, put:
<?php
if( isset( $_GET['preview'] ) ) {
require( "preview.php" );
die(); # a horrible death
}
?>

How to embed modules on pages?

I have created my own extension and modules. I can view the modules fine, by going to their URL. However, now I want to embed them on a page, much like a content class. How do I go about doing that?
Thanks!
You have to create template operator or function and use them in template.
It is not possible to "embed" a module in a page except if the module which is called do it at the PHP level.
For instance, it's possible to write this :
$module = eZModule::findModule( 'content' );
$result = $module->run( 'history', array( 1 ) );
But if you want to display anything related to your module, you should declare that your extension contains some templates and override some templates.
Let's say that you would like to make your own register module.
Step 1, you may have to add this in your_extension/settings/design.ini.append.php :
[ExtensionSettings]
DesignExtensions[]=your_extension
So you are now able to add your own user/register.tpl
This template contains a form like this :
<form action={'/user/register'|ezurl}...
So you just need to copy the template but with :
<form action={'/your_module/register'|ezurl}...
Now let's say that your template is supposed to display some informations related to your module. You may have to define some fetch functions so you would be able to write something like this:
{def $nb = fetch('your_module','beta_accounts')}
<h2>Hurry up! There are only {$nb|wash} available accounts for free!</h2>
<form action={'/your_module/register'|ezurl} method="POST">
...
</form>
I hope that it will help...

Categories