Forums / Built-in Shipping and Payment Modules / How To Get Per Item to Not Show $0.00

How To Get Per Item to Not Show $0.00

Views: 1,400

Results 1 to 11 of 11
31 Dec 2010, 2:19 AM
#1
zippkits avatar

zippkits

New Zenner

Join Date:
Dec 2010
Location:
Central Indiana
Posts:
36
Plugin Contributions:
0

How To Get Per Item to Not Show $0.00

Almost finished setting up our new site for 2011.
We have a bunch of products at 0 weight.
Using cloned modules, the customer has a choice of Economy ($3.00) or Priority ($5.00).
For some reason, per item is also there with a $0.00 price.

We have to use per item for the other products with weight.

Is there any way to get the per item to not show if the weight is 0?

Thanks in advance,

Joe

31 Dec 2010, 4:54 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How To Get Per Item to Not Show $0.00

You could customize the code in the Per Unit perweightunit shipping module with:

    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_PERWEIGHTUNIT_STATUS == 'True') ? true : false);
    }

    global $cart;
    if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() == 0) {
      $this->enabled = false;
    }

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

31 Dec 2010, 7:18 PM
#3
zippkits avatar

zippkits

New Zenner

Join Date:
Dec 2010
Location:
Central Indiana
Posts:
36
Plugin Contributions:
0

Re: How To Get Per Item to Not Show $0.00

Thank you!
Works perfectly!

Joe

31 Dec 2010, 7:26 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How To Get Per Item to Not Show $0.00

Thanks for the update that this is now working for you ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

31 Dec 2010, 8:10 PM
#5
zippkits avatar

zippkits

New Zenner

Join Date:
Dec 2010
Location:
Central Indiana
Posts:
36
Plugin Contributions:
0

Re: How To Get Per Item to Not Show $0.00

Bought the team a cup of really good coffee :smile:
Thanks again.

31 Dec 2010, 8:11 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How To Get Per Item to Not Show $0.00

Appreciate the coffee! Have a good holiday! :cool:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

28 Jan 2011, 6:06 PM
#7
nictech avatar

nictech

New Zenner

Join Date:
Sep 2004
Location:
New Brunswick, Canada
Posts:
57
Plugin Contributions:
0

Re: How To Get Per Item to Not Show $0.00

Working on similar problem here:
http://habitathaven.com/cart

Want my shipping to be if weight 1lb or greater -> display Zones Table Rate

If weight = 0lbs default to Request Freight Quote

I have the zonetable.php working fine, displays on over 1lb, hides on 0lbs.

My problem is telling the Request Freight Quote to disable on 1lb or greater.

Here is the section of code from includes/modules/shipping/rfq.php I have noted my custom code, does it look right? Did I put custom code in proper place? Help!
Thanks

// class constructor
    function rfq() {
	  global $order, $db;
      $this->code = 'rfq';
      $this->title = MODULE_SHIPPING_RFQ_TEXT_TITLE;
      $this->description = MODULE_SHIPPING_RFQ_TEXT_DESCRIPTION;
      $this->sort_order = MODULE_SHIPPING_RFQ_SORT_ORDER;
      $this->icon = DIR_WS_ICONS . 'shipping_rfq.gif';
      $this->enabled = ((MODULE_SHIPPING_RFQ_STATUS == 'True') ? true : false);
	  if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_RFQ_ZONE > 0) ) {
        $check_flag = false;
        $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id <> '" . MODULE_SHIPPING_RQF_ZONE . "' and zone_country_id <> '" . $order->delivery['country']['id'] . "' order by zone_id");
        while (!$check ->EOF) {
/* MY CUSTOM CODE START XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
	 global $cart;
         if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() >= 1) {
         $this->enabled = false;
         }
/* MY CUSTOM CODE FINISH XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
          if ($check->fields['zone_id'] < 1) {
            $check_flag = true;
            break;
          }
		   elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
          $check->MoveNext();
		}
	
		if ($check_flag == false) {
          $this->enabled = false;
        }
      }
    }
28 Jan 2011, 6:49 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How To Get Per Item to Not Show $0.00

And if you move your code to be below:

      $this->enabled = ((MODULE_SHIPPING_RFQ_STATUS == 'True') ? true : false);

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

28 Jan 2011, 7:46 PM
#9
nictech avatar

nictech

New Zenner

Join Date:
Sep 2004
Location:
New Brunswick, Canada
Posts:
57
Plugin Contributions:
0

Re: How To Get Per Item to Not Show $0.00

Again, Ajeh saves the day, works perfectly in both the Estimator and Checkout.

Many Thanks

28 Jan 2011, 7:48 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How To Get Per Item to Not Show $0.00

You are most welcome ... thanks for the update that moving your custom code to the right location helped resolve your issues ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

28 Jan 2011, 7:59 PM
#11
nictech avatar

nictech

New Zenner

Join Date:
Sep 2004
Location:
New Brunswick, Canada
Posts:
57
Plugin Contributions:
0

Re: How To Get Per Item to Not Show $0.00

I was the confident in the code, (the author is brilliant), was just stuck in my head it had to go below the first " if ".

Wow! been here 7 years and still a newbie, great testament to the quality of info the team here has compiled. Usually the search buttom solves all my issues.