Site maintenance: Sun 15 Nov, from 20:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Bug Reports / [not a bug] Erroneous free shipping on 1 real item + 1 virtual item in cart

[not a bug] Erroneous free shipping on 1 real item + 1 virtual item in cart

Locked

Started by dbrewster on 2 Nov 2006, 7:26 PM · Views: 4,220

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
2 Nov 2006, 7:26 PM
#1
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

[not a bug] Erroneous free shipping on 1 real item + 1 virtual item in cart

Ajeh was going to check this out on a clean install, but she's probably been too busy. I've tried all sorts of configurations, but as far as I can tell, everything is configured how it should be. This is reproducible behavior. Previous discussion found here: http://www.zen-cart.com/forum/showthread.php?t=48506

Bug: Still happening in version 1.3.6.

If you have a virtual item [weightless, purchaseable] in your cart, for example a downloadable file which is purchased, and you have one other real item, which has a real weight, you will be charged 0 shipping. If you increase the quantity of your real item to 2, or if you add another real item to your cart, shipping is correctly calculated. I've found this to be true for flat shipping, MZMT, and my USPS handling % custom module, but USPS is also the same.

Total weight displays correctly at the top of the shopping cart, but no shipping option other than "FREE SHIPPING!" shows.

Configuration:

Modules > shipping > "FREE SHIPPING!" i.e."freeshipper" ON. This is required when items with 0 weight are configured to have 0 shipping cost.

Configuration > shipping/packaging > Order Free Shipping 0 Weight Status.

Order Free Shipping 0 Weight Status
If there is no weight to the order, does the order have Free Shipping?
0= no
1= yes

Note: When using Free Shipping, Enable the Free Shipping Module this will only show when shipping is free.

Virtual item is set to 0 weight
Product is free = No
Product is virtual = Yes
Always Free Shipping = No, normal shipping rules

If this is a misconfiguration on my part, I'd love to fix it.

This behavior can be examined in my online test site:
http://register.coreknowledge.org
virtual item= http://www.coreknowledge.org/register/index.php?main_page=product_info&products_id=146

---Diana

20 Nov 2006, 7:08 PM
#2
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: [not a bug] Erroneous free shipping on 1 real item + 1 virtual item in cart

Hello,

Yes bumping is incorrect message board behavior, but ... is there any likelihood of this being fixed in the next patch? We have a book and when it's sold with its (electronic) Teacher Guide, it gets free shipping, even if we don't want it to have free shipping.

---Diana

21 Nov 2006, 3:49 AM
#3
ajeh avatar

ajeh

Oba-san

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

Re: [not a bug] Erroneous free shipping on 1 real item + 1 virtual item in cart

The bug isn't a bug but rather you have a misconfigured Product ... :eek:

There are Products, Downloads and Virtual Products ...

You have made a Download that is also marked Virtual ...

This is causing the issue as the check on:
Product
Virtual
Download

Cannot count properly as you have more or less assigned 2 definitions to the same Product by doing this ...

Try turning Product is Virtual NO on one of your Downloads and then test this ...

Does it work better now?

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!

27 Nov 2006, 4:30 PM
#4
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: [not a bug] Erroneous free shipping on 1 real item + 1 virtual item in cart

Aaaahhhh!!

This fixes it!

BUT

I have a new important problem (owing to my misunderstanding of the download/virtual product settings.)

Because we have many customers who use purchase orders, we did not want to allow purchase of downloadable documents via purchase order, since some never settle, and we don't want children having access to test answers.

So, we had a custom payment control written (by Absolute) which... uses "Virtual Product" as the conditional trigger for allowing or denying use or presentation of purchase order at checkout.

What logical trigger should I use in such statements instead?

Here's the critical function:

if ($product_check->fields['virtual'] == '1' && $product_check->fields['free'] != '1') {
		  $po_enabled = false;
		}

---Diana

27 Nov 2006, 4:43 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: [not a bug] Erroneous free shipping on 1 real item + 1 virtual item in cart

Payment modules can be set to not show Downloads as immediately available until you approve the order just by changing the Orders Status to 1 on the Payment Module ...

If the Orders Status is >=2 and <= 4 then the Download is available ...

This allows you to have some Payment modules immediately make the downloads available and others require approval or a orders status change on the Order before the Download is available ...

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!

27 Nov 2006, 5:56 PM
#6
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: [not a bug] Erroneous free shipping on 1 real item + 1 virtual item in cart

ahh....

That would be great.

Our Purchase Order module is quite lame in that respect.

Here's the configuration screen:

Will you accept Purchase Order?

Allow Purchase Orders
True

Sort Order
20

That's the whole thing.

Looks like it needs more development.

I'll hunt around in the database to see where a product is defined as a download item, and see if the conditional logic can be fixed to deny payment by purchase order.

thank you so much for your speedy follow-up Ajeh-Linda :wub:

---Diana

27 Nov 2006, 8:06 PM
#7
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: [not a bug] Erroneous free shipping on 1 real item + 1 virtual item in cart

Question:

Where is products_id from the products table joined with the products_options_values table? How is a product linked with its options/values/attributes?

In my code sample below, the $product_option statement: I know this won't work. It's my "monkey see, monkey do" style of programming :yuck: [i.e., pretty ignorant.] From scouting around in the database, one way that would work [but not very robust] be to check if products_options_values_name = PDF. But I'm not seeing how a product in the products table gets connected to its options.

The rule I'm trying to meet is "Don't show purchase order payment option if any item in the shopping cart is a downloadable non-free item." We have a free PDF download that I want to exclude from the do not show purchase order payment option rule.

Or, I could try and add the order status setting to the purchase order module, if it works as you (Linda) describe for download items. Hmm... can you suggest an example module to try out my monkey-see monkey-do programming skillz?

In includes\modules\payment\po.php (our PO module)

function selection() {
	  global $order, $db;

	  $po_enabled = true;
	  $products = $order->products;

	  foreach ($products as $product) {

      $product_check = $db->Execute("select product_is_free as free from " 
. TABLE_PRODUCTS . " where products_id = '" . zen_get_prid($product['id']) . "'");
      $product_option = $db->Execute("select products_options_values_name as 
option from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where 
products_options_values_id = '" . zen_get_prid($product['id']) . "'");
	if ($product_option->fields['option'] == 'PDF' && $product_check->fields['free'] != '1') {
		$po_enabled = false;
	}
}

If you have any ideas for me, I'd love to hear them. Otherwise, I think it's back to Mr. Chris of Absolute to give it a re-work.

---Diana

28 Nov 2006, 2:04 AM
#8
ajeh avatar

ajeh

Oba-san

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

Re: [not a bug] Erroneous free shipping on 1 real item + 1 virtual item in cart

You might speak to Absolute and see if he can't pop in the logic for this to that module for managing the orders status ...

That would be the best solution ...

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!

3 Dec 2006, 7:23 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: [not a bug] Erroneous free shipping on 1 real item + 1 virtual item in cart

An possible base of code to spring from would be the get_content_type() element of the shopping cart class.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.