Help - Virtuemart Mobile template

Requirements

Please pay attention to the requirements. These are mandatory:

 

 


Installation instructions

Please follow these steps carefully:

  1. Download and install Mobile Joomla
  2. Purchase and install Mobile Joomla Elegance template based on jQueryMobile technology (optional but highly recommended)
  3. Configure Mobile Joomla accordingly
  4. Install Virtuemart mobile theme
  5. Publish the 'mod_virtuemart_mobile' module in a mobile footer position.
  6. If you use Mobile Elegance template, configure it to use jQueryMobile version 2 and Ajax Browsing

Your theme will now be automatically switched to the iPhone one when browsing your site from an mobile device.

Additional changes if you run a version prior 1.1.9

Why these manual changes ?
Well, The component relies on the latest stable versions of Virtuemart, leveraging all the power of it without applying any hack to the core files.
Components that does such hacks don't always warn you and stop working when you upgrade your version of Virtuemart.
Because of that, you refrain from upgrading your Virtuemart, missing bug fixes, improvements as well as security fixes. We don't want you to face that and recommend that you always use the latest stable version.
If your Virtuemart instance is already hacked, below are some pieces of code to implement. These changes are not custom but from Virtuemart newer versions. This means out component won't stop working if you decide to upgrade your Virtuemart.

Open the file located in components/com_virtuemart/virtuemart.php
Around line 156, locate the code

// Load requested PAGE
if( file_exists( PAGEPATH.$modulename.".".$pagename.".php" )) {
if( $only_page) {
require_once( CLASSPATH . 'connectionTools.class.php' );
vmConnector::sendHeaderAndContent( 200 );
if( $func ) echo vmCommonHTML::getSuccessIndicator( $ok, $vmDisplayLogger );
include( PAGEPATH.$modulename.".".$pagename.".php" );
// Exit gracefully
$vm_mainframe->close(true);
}
include( PAGEPATH.$modulename.".".$pagename.".php" );
} elseif( file_exists( PAGEPATH . HOMEPAGE.'.php' )) {
include( PAGEPATH . HOMEPAGE.'.php' );
} else {
include( PAGEPATH.'shop.index.php');
}

and replace with

// Load requested PAGE// added/mod by JK to support user pages
$user_path=VM_THEMEPATH.'user_pages/';
if( file_exists( $user_path.$modulename.".".$pagename.".php" )) {
if( $only_page) {
require_once( CLASSPATH . 'connectionTools.class.php' );
vmConnector::sendHeaderAndContent( 200 );
if( $func ) echo vmCommonHTML::getSuccessIndicator( $ok, $vmDisplayLogger ); 
include( $user_path.$modulename.".".$pagename.".php" );
// Exit gracefully
$vm_mainframe->close(true);
}
include( $user_path.$modulename.".".$pagename.".php" );
} elseif( file_exists( PAGEPATH.$modulename.".".$pagename.".php" )) {
// added/mod by JK to support user pages ends
if( $only_page) {
require_once( CLASSPATH . 'connectionTools.class.php' );
vmConnector::sendHeaderAndContent( 200 );
if( $func ) echo vmCommonHTML::getSuccessIndicator( $ok, $vmDisplayLogger ); 
include( PAGEPATH.$modulename.".".$pagename.".php" );
// Exit gracefully 
$vm_mainframe->close(true);
}
include( PAGEPATH.$modulename.".".$pagename.".php" );
} elseif( file_exists( PAGEPATH . HOMEPAGE.'.php' )) {
include( PAGEPATH . HOMEPAGE.'.php' );
} else {
include( PAGEPATH.'shop.index.php');
}

Additional changes if you run a version 1.1.3

Virtuemart 1.1.3 does not handle extended classes (introduced in Virtuemart 1.1.4. You will then need to update some more core Virtuemart files in order to handle the extended classes.

Here are the list of files you will need to update :

  • administrator/components/com_virtuemart/classes/ps_credit_card.php
  • administrator/components/com_virtuemart/classes/ps_order.php
  • administrator/components/com_virtuemart/classes/ps_product.php
  • administrator/components/com_virtuemart/classes/ps_reviews.php
  • administrator/components/com_virtuemart/classes/ps_session.php
  • administrator/components/com_virtuemart/classes/ps_shopper.php
  • administrator/components/com_virtuemart/classes/ps_user.php
  • administrator/components/com_virtuemart/classes/ps_userfield.php

In each file, you will need to modify the class name by adding a 'vm_' prefix :

class ps_creditcard {

change to

class vm_ps_creditcard {

Then in the bottom of the file, after the last bracket and before the php closing tag (?>) add the following piece of code :

// If settings are loaded, extended Classes are allowed and the class exisits...
if (defined('VM_THEMEPATH') && file_exists(VM_THEMEPATH.'user_class/'.basename(__FILE__))) {
// Load the theme-user_class as extended
include_once(VM_THEMEPATH.'user_class/'.basename(__FILE__));
} else {
// Otherwise we have to use the original classname to extend the core-class
class ps_creditcard extends vm_ps_creditcard {}
}

A few more exceptions:

At the end of the ps_order.php and ps_shopper.php file, you'll find this piece of code :

$ps_order = new ps_order;

Insert the previous code above this piece of code

And finally, the ps_session.php has a constructor function :

function ps_session() {

change it to

function vm_ps_session() {

Top
joomlart