Forums / All Other Contributions/Addons / shipworks plugin

shipworks plugin

Started by delia on 7 Aug 2007, 11:50 PM · Views: 21,408

Results 21 to 40 of 88
25 Nov 2007, 6:44 PM
#21
jayhos avatar

jayhos

New Zenner

Join Date:
Aug 2007
Posts:
8
Plugin Contributions:
0

shipworks plugin

Duh... Alright, stupid error. First I forgot to install the override file. Second, if you forget to put shipworks.php after the directory in which shipworks is installed you will receive the same error.

25 Nov 2007, 7:18 PM
#22
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: shipworks plugin

I'll be looking into this this week.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

28 Mar 2008, 1:47 PM
#23
gamer avatar

gamer

New Zenner

Join Date:
Aug 2007
Posts:
25
Plugin Contributions:
0

Re: shipworks plugin

This mod will pay for itselft in one day if you procces more than 10 orders a day. I would reccomend this to anyone.

If you use Dazzle, be sure to upgrade to premium serivce.

Im trying to install a work staition on a second PC but having trouble seeing the shipworks sql server on the network. Do I need to forward any ports on my router to get this to work? I can see the UPS sql server from Worldship fram the same master PC, thus I am at a loss.

Thanks

28 Mar 2008, 1:50 PM
#24
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: shipworks plugin

I have no earthly idea. Sorry.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

28 Mar 2008, 2:40 PM
#25
gamer avatar

gamer

New Zenner

Join Date:
Aug 2007
Posts:
25
Plugin Contributions:
0

Re: shipworks plugin

Thanks for your time

29 Mar 2008, 4:49 AM
#26
billt avatar

billt

Zen Follower

Join Date:
Aug 2004
Posts:
93
Plugin Contributions:
0

Re: shipworks plugin

Will this work with 1.3.8a?

29 Mar 2008, 2:43 PM
#27
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: shipworks plugin

Yes, it should. There are no modified files = only additional files

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

18 Apr 2008, 1:58 PM
#28
eaprandy avatar

eaprandy

New Zenner

Join Date:
Mar 2008
Posts:
11
Plugin Contributions:
0

Re: shipworks plugin

I just installed Shipworks in Zen and am running into a strange problem.

Shipworks is giving me invoices where the total price is totally wrong. I suspect this has to do with the fact that I'm using Attributes to set the pricing in Zen. The way I have this set up is the base product, with its description, etc is entered as a 0 Price (Net) and Price (Gross) item. All of the pricing takes place in the attributes area for each product. This setup works fine in Zen and is more customer friendly IMHO since users don't have to add up a base price Plus additional for the attribute.

However when I pull the orders into ShipWorks its invoice shows one line with the product info, including the price from the attributes, followed by a second (lighter text) line that shows just the Attribute info, with the price again. Then SW is adding those two lines together, basically doubling the pre-tax/pre-shipping costs reflected on the invoice.

Has anyone run into this one before? Is there any relatively easy way to fix it? Perhaps by commenting out the attributes price section in the shipworks.php code?

I guess the other option would be to never use SW's Invoice feature and just include a packing list with the shipment. Though I think it would be nice to include an actual invoice, with pricing, for the customers reference.

FTR, I'm on Zen 1.3.8a.

18 Apr 2008, 3:19 PM
#29
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: shipworks plugin

That's problem for the shipworks folks. I haven't used it myself - just set up the module to work with zencart.

Anybody else who uses shipworks got an answer for him?

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

18 Apr 2008, 4:35 PM
#30
drbyte avatar

drbyte

Sensei

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

Re: shipworks plugin

delia,
The code in the shipworks exporter doesn't handle attributes correctly, at least for attribute-specific weight. I suspect that attribute-pricing is the same issue.

.
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.

18 Apr 2008, 4:37 PM
#31
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: shipworks plugin

thanks, I'll check it out and see if there's anything I can do about that.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

18 Apr 2008, 5:50 PM
#32
eaprandy avatar

eaprandy

New Zenner

Join Date:
Mar 2008
Posts:
11
Plugin Contributions:
0

Re: shipworks plugin

I haven't gotten far enough along to look at shpping weight issues yet, but I'll get there eventually since I'm a fan of ShipWorks and a growing fan of ZenCart.

FTR, I was able to find a quick and dirty work around for my original question. In case anybody runs into the same problem in the future, you can get rid of the double billing (not really double billed since Zen will handle the payment processing, just an appearance of double billing on the invoice print) with one quick and simple edit.

You'll want to look around line 516 in the /admin/shipworks.php file. The section looks like:

writeStartTag("Attribute");
writeElement("AttributeID", $att->fields['orders_products_attributes_id']);
writeElement("Name", $att->fields['products_options']);
writeElement("Value", $att->fields['products_options_values']);
writeElement("Price", $price * $currencyFactor);
writeCloseTag("Attribute");
$att->MoveNext();
}

Simply commenting out the writeElement("Price", line will remove the price on the attribute for your invoices. The rest of the attribute will still be there --and I need it there because mine is a number of items attribute-- however the price will be MIA and get things adding up correctly again.

After you do this you'll need to go into ShipWorks > Orders > Delete Order to zap all of the orders you've downloaded since SW already has the faulty info. After you delete 'em all simply download them again and you're good to go.

FWIW, it appears ShipWorks is doing this because the price has already been grabbed from the "orders" table in the database, but the same item price also appears in orders_products_attributes table. So it ends up being in there twice. If the weight thing is along the same lines where the shpping weight is ending up doubling what it should be (I've not even glanced at it yet) it should be another easy fix.

19 Apr 2008, 3:59 AM
#33
eaprandy avatar

eaprandy

New Zenner

Join Date:
Mar 2008
Posts:
11
Plugin Contributions:
0

Re: shipworks plugin

I think I've got the attribute weight problem on the run too. DrByte was 100% correct that it's an issue with the original code from Shipworks, not Delia's port of the code. Here's what I ended up with that seems to work.

This first example assumes you either have your base products set up with a 0 weight or some default weight value, and then you're adding on more weight with the attributes. It involves a few changes to a couple of functions.

Rather than paste each line in code boxes here that seems to freak out the forum I'm going to paste in both of the tweaked functions. The changes were just a few and are around the following lines: 442, 474-478, 492 and 505-506.

    // Write XML for all products for the given order
    function WriteOrderItems($orderID, $currencyFactor)
    {
        global $db, $att_weight;
        $imageRoot = HTTP_CATALOG_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES;

        $item = $db->Execute(
            "select * from " . TABLE_PRODUCTS .
            " INNER JOIN ".TABLE_ORDERS_PRODUCTS." USING(products_id)".
            " where orders_id = " . $orderID);

        writeStartTag("Items");

        while(!$item->EOF)
        {
            if( function_exists( "sw_OrderItems_row_hook" ) )
            {
                sw_OrderItems_row_hook( $item );
            }

            // Build fully qualified image url
            $imageUrl = $product->fields['products_image'];
            if (isset($imageUrl) and strlen($imageUrl) > 0)
            {
                $imageUrl = $imageRoot . $imageUrl;
            }

            writeStartTag("Item");
                writeElement("ItemID", $item->fields['orders_products_id']);
                writeElement("ProductID", $item->fields['products_id']);
                writeElement("Code", $item->fields['products_model']);
                writeElement("Name", $item->fields['products_name']);
                writeElement("Quantity", $item->fields['products_quantity']);
                writeElement("UnitPrice", $item->fields['final_price'] * $currencyFactor);
                writeElement("Image", $imageUrl);

                // Write attributes
                WriteItemAttributes($item->fields['orders_products_id'], $currencyFactor);

                writeElement("Weight", $item->fields['products_weight'] + $att_weight); //moved old Weight and added

            writeCloseTag("Item");
            $item->MoveNext();//!!added
        }

        writeCloseTag("Items");
    }

    /* --------------------- */

    // Write all attributes for the item
    function WriteItemAttributes($itemID, $currencyFactor)
    {
        global $db, $att_weight;

        $att = $db->Execute(
            "select * from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES .
            " where orders_products_id = " . $itemID);

        writeStartTag("Attributes");

        while(!$att->EOF)
        {
            if( function_exists( "sw_ItemAtributtes_row_hook" ) )
            {
                sw_ItemAttributes_row_hook( $att );
            }
            $price = $att->fields['options_values_price'];
            $att_weight = $att->fields['products_attributes_weight']; //added

            if ($att->fields['price_prefix'] == '-')
            {
                $price = -$price;
            }


            writeStartTag("Attribute");
                writeElement("AttributeID", $att->fields['orders_products_attributes_id']);
                writeElement("Name", $att->fields['products_options']);
                writeElement("Value", $att->fields['products_options_values']);
//                writeElement("Price", $price * $currencyFactor);
            writeCloseTag("Attribute");
            $att->MoveNext();
        }

        writeCloseTag("Attributes");
    }

That should do the trick to get weight attributes working if you have a 0 weight on your base product or a default weight and your attribute adds to this figure.

19 Apr 2008, 4:08 AM
#34
eaprandy avatar

eaprandy

New Zenner

Join Date:
Mar 2008
Posts:
11
Plugin Contributions:
0

Re: shipworks plugin

And just for the record, if you have a strange setup like mine where the base product has a weight but instead of adding to it with your Attributes you simply declare a whole new weight (I don't like the look of the plus symbols in the cart) it's an easy one to fix.

With this sort of setup you'd have your base product with a weight, and the first attribute adding 0 weight. So we simply test for that, and subtract the default product weight from the $att_weight total.

In my case the default is 1 pound. So where the new $att_weight is declared in the WriteItemAttributes function I have it like the following instead of the single line above.

$att_weight = $att->fields['products_attributes_weight'];
  if ($att_weight > 0) 
  {
    $att_weight = $att_weight - 1;
  }

Also, if you need to add a Tare weight in for shipping purposes to get a correct weight, you do this in the new writeElement("Weight line from the WriteOrderItems function. For example:

$tare = 1.50;
writeElement("Weight", $item->fields['products_weight'] + $att_weight + $tare);

There ya go. Some new ways to mess around with Shipworks. ;)

23 Apr 2008, 9:24 PM
#35
sarabz avatar

sarabz

New Zenner

Join Date:
Oct 2007
Posts:
14
Plugin Contributions:
0

Re: shipworks plugin

Ok, I found an issue with Shipworks not processing our most recent orders. It shows they need to be downloaded, but they don't get processed until much later. It seems to be fixed by changing the date in the code (admin/shipworks.php)

from

// Only get orders through 2 seconds ago.
$end = date("Y-m-d H:i:s", time() - 2);

to

// Only get orders through 2 seconds ago.
//$end = date("Y-m-d H:i:s", time() - 2);
//Changed to check for orders from now through 1 day in the future (bug fix?)
$end = date("Y-m-d H:i:s", time() + 86400);

hopefully that helps someone - this gave us a big headache, it probably has something to do with the server that runs our zencart is on the other side of the world than our computer running Shipworks :-)

7 May 2008, 12:04 PM
#36
knuckle_101 avatar

knuckle_101

Totally Zenned

Join Date:
Dec 2005
Location:
Cincinnati Ohio
Posts:
1,034
Plugin Contributions:
3

Re: shipworks plugin

Would anyone be delighted to tell us how to configure this module for a client?

Like where to add username password? And where do we configure it?

Any help is greatly appreciated.

PCI Certified Web Hosting - ControlScan, Security Metrics (Platinum Partner), McAfee, TrustKeeper
Business Class Web Hosting - Linux and cPanel Powered

7 May 2008, 12:10 PM
#37
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: shipworks plugin

PLease refer to the shipworks documentation. This module for shipworks only enables shipworks to be used with zencart.

interapptive.com

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

7 May 2008, 12:14 PM
#38
knuckle_101 avatar

knuckle_101

Totally Zenned

Join Date:
Dec 2005
Location:
Cincinnati Ohio
Posts:
1,034
Plugin Contributions:
3

Re: shipworks plugin

So to be clear when the customer activates his shipworks client this module will be picked up correct?

PCI Certified Web Hosting - ControlScan, Security Metrics (Platinum Partner), McAfee, TrustKeeper
Business Class Web Hosting - Linux and cPanel Powered

7 May 2008, 12:16 PM
#39
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: shipworks plugin

Yes, if you have these two files in place in your admin, shipworks will work.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

7 May 2008, 12:19 PM
#40
knuckle_101 avatar

knuckle_101

Totally Zenned

Join Date:
Dec 2005
Location:
Cincinnati Ohio
Posts:
1,034
Plugin Contributions:
3

Re: shipworks plugin

Thank you greatly, I will inform the customer.

PCI Certified Web Hosting - ControlScan, Security Metrics (Platinum Partner), McAfee, TrustKeeper
Business Class Web Hosting - Linux and cPanel Powered