Jump to content

Need help to add additional shipping charge to downloadable products


hiltonroutley

Recommended Posts

Would really appreciate the help if someone could tell me how to make a shipping charge go with downloadable products. I set up in my shop the "shipping" charge to "Service Charge" so it's important that I get a shipping charge to show up with my downloadable products because my shop does downloadable tickets.

 

Someone please help!

 

www.gofest.ca

Link to comment
Share on other sites

  • 1 month later...

Ok, I found a quick solution. I need to test it fully to make sure it's not impacting any other functionality:

  1. Open /classes/Cart.php and go down to line 1433.
  2. Edit the function isVirtualCart() so it looks like this: public function isVirtualCart(){return false;}

Seems to be working great though. I can add "Additional Shipping" for downloadable products, and now that extra cost gets calculated in my cart. :D

Edited by evanburke (see edit history)
Link to comment
Share on other sites

just to clarify for any others that need help. I'm also making sure with evanburke this is the right way to do it.

 

so in cart.php you go to the part of the code that says

public function isVirtualCart()
{
 if (!isset(self::$_isVirtualCart[$this->id]))
 {
  $products = $this->getProducts();
  if (!sizeof($products))
   return false;
  $list = '';
  foreach ($products AS $product)
   $list .= (int)($product['id_product']).',';
  $list = rtrim($list, ',');
  $n = (int)Db::getInstance()->getValue('
  SELECT COUNT(`id_product_download`) n
  FROM `'._DB_PREFIX_.'product_download`
  WHERE `id_product` IN ('.pSQL($list).') AND `active` = 1');
  self::$_isVirtualCart[$this->id] = ($n == sizeof($products));
 }
 return self::$_isVirtualCart[$this->id];
}

 

Then you add "{return false;}" and remove the rest so it should look like this?

public function isVirtualCart(){return false;}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...