ShipWorks and Zen Cart Discounts

I just discovered that ShipWorks does not properly handle the many possible discounts that can be created for ZenCart by independent software developers (like your humble servant).

Fortunately, it’s an easy fix. Just edit your admin/shipworks3.php file.

Locate the block:

                    if ($class == "ot_coupon" ||
                                    $class == "ot_gv" ||
                                    $class == "ot_lev_discount" ||
                                    $class == "ot_group_pricing" ||
                                    $class == "ot_quantity_discount")
                    {
                            $impact = "subtract";
                    }

and change it to:

                    $textvalue = $total->fields['text'];
                    if (strpos($textvalue, "-") !== false)
                    {
                            $impact = "subtract";
                    }

I have passed this fix on to the ShipWorks team so hopefully they will integrate it into the supported version of the Zen Cart integration soon.

osCommerce users – you will likely need a similar change.

One thought on “ShipWorks and Zen Cart Discounts”

  1. Just noting that this has not been changed in the latest shipworks3.php AND that line 742 should be changed from:

    while (list($key, $val) = each($codes))

    to

    foreach ($codes as $key => $val)

    This avoids the deprecated each() PHP warning

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.