Forum
Welcome, Guest

Free shipping not working with custom ship module
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Free shipping not working with custom ship module

Free shipping not working with custom ship module 1 year ago #2560

  • mbrando
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hi,

I have a custom shipping module that I'm using with VM. The free shipping setting does not seem to work. I'm thinking I should be able to grab a session variable to if the coupon is used. When I set debug on $_SESSION says

cfvm_prodfreeship=>0
cfvm_freeship=>0

for both 'Y' and 'N'. I'm guessing that '0' is 'N' and '1' would be 'Y' Free Shipping?

- Mike

Re: Free shipping not working with custom ship module 1 year ago #2561

  • nicholas
  • OFFLINE
  • Moderator
  • Developing for Joomla since it was born!
  • Posts: 1197
Hello -

The system is designed to backout the shipping weight for all products which are covered by the free shipping. What kind of shipping module are you using? The process we have in place works for Standard and every other weight-based shipping method.
Nicholas
CIO - CorFun, Inc.
Publisher - orthodoxbiz.com
Webmaster - Orthodox Christian Network

Re: Free shipping not working with custom ship module 1 year ago #2562

  • mbrando
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hi,

This ship module is based on counts. $5 for first item and $1 for each additional item. I was hoping I could make use of the session variables to trigger logic for free shipping. Such as

If ( $_SESSION['cfvm_freeship'] == 1 ) {
 
$ship_total = 0.00;
 
}


If that worked then I want to be able write additional code to remove shipping at the product level as I loop through the order so it is not just free shipping for the entire order.

- Mike

Re: Free shipping not working with custom ship module 1 year ago #2563

  • jasper
  • OFFLINE
  • Administrator
  • Posts: 148
Hello Mike,

Here is a snippet of code from basket.php. do a print_r or an echo and you will see how the fields work together. You should be able to accomplish your goal. check to see you are offering free shipping on the product, 99911 means all items are free. If you are offering free shipping for a specific number then the code below is backing out that number by the weight.

$backoutnumber =0;
if ($_SESSION['cfvm_prodfreeshipnum'] == '99911')
$backoutnumber = $cart[$i]['quantity'];
if ($_SESSION['cfvm_prodfreeship'] == $cart[$i]["product_id"])
$backoutnumber = $_SESSION['cfvm_prodfreeshipnum'];
$weight_subtotal = ps_shipping_method::get_weight($cart[$i]["product_id"]) * ($cart[$i]['quantity'] - $backoutnumber);
$weight_total += $weight_subtotal;
The following user(s) said Thank You: mbrando

Re: Free shipping not working with custom ship module 1 year ago #2564

  • mbrando
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hi,

Thank you. I'll work with this and post back to this thread if I have questions.

- Mike

Re: Free shipping not working with custom ship module 12 months ago #2585

  • mbrando
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hi,

This worked great.

		if ( $_SESSION['cfvm_prodfreeshipnum'] == 99911 ) {
$total = 0.00;
}
 
return $total;
 
 


I'm just setting free shipping for the entire order instead of on an item basis.

- Mike
  • Page:
  • 1
Time to create page: 0.79 seconds

Login