Author Topic: Fast checkout process for virtual products not downloadable ?  (Read 2000 times)

Mister Paul

  • Jr. Member
  • **
  • Posts: 279
  • Joomla! 3.9.6 - VirtueMart 3.4.2
Hi,

I am looking for an simplified checkout process for membership subscription.
Almost like for a downloadable product (Payment Method - Complete Order) ... but with nothing to download !

How could I manage that ?
(I don't know if it could help but all my subscription plans belong to the same product category... so we could use its ID for an If statement)

Thank you for your help !
 ;)

Paul

Mister Paul

  • Jr. Member
  • **
  • Posts: 279
  • Joomla! 3.9.6 - VirtueMart 3.4.2
Re: Fast checkout process for virtual products not downloadable ?
« Reply #1 on: May 30, 2011, 14:52:43 pm »
There is the functions noShipToNecessary() and noShippingMethodNecessary()

But it works only for downloadable products...

How could I modify this code to make it relevant to my totally virtual products (no ship + no download) ?...
 ???

Code: [Select]
/**
* Checks if Ship To can be skipped
*
* @return boolean
*/
function noShipToNecessary() {
global $cart, $only_downloadable_products;
if( NO_SHIPTO == '1') {
return true;
}
if( !isset( $cart)) $cart = ps_cart::initCart();

if( ENABLE_DOWNLOADS == '1') {
$not_downloadable = false;
require_once( CLASSPATH .'ps_product.php');
for($i = 0; $i < $cart["idx"]; $i++) {

if( !ps_product::is_downloadable($cart[$i]['product_id']) ) {
$not_downloadable = true;
break;
}
}
return !$not_downloadable;
}
return false;
}
function noShippingMethodNecessary() {
global $cart, $only_downloadable_products;
if( NO_SHIPPING == '1') {
return true;
}

if( !isset( $cart)) $cart = ps_cart::initCart();

if( ENABLE_DOWNLOADS == '1') {
$not_downloadable = false;
require_once( CLASSPATH .'ps_product.php');
for($i = 0; $i < $cart["idx"]; $i++) {
if( !ps_product::is_downloadable($cart[$i]['product_id']) ) {
$not_downloadable = true;
break;
}
}
return !$not_downloadable;
}
return false;
}
function noShippingNecessary() {
return $this->noShipToNecessary() && $this->noShippingMethodNecessary();
}