Results 1 to 10 of 38

Hybrid View

  1. #1
    Join Date
    Jan 2004
    Posts
    66,445
    Plugin Contributions
    81

    Default Re: Use Of Notifiers - How To

    Quote Originally Posted by SteveKim View Post
    I'm just putting the static tare value matching what I've put on the configuration, unless there is a method of saving $weight in shopping_cart class to some other (global?) varible that does not get reset and passed onto my observer.
    Try using this:
    Code:
     $_SESSION['cart']->weight
    .

    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.

  2. #2
    Join Date
    Apr 2007
    Location
    Los Angeles, CA
    Posts
    45
    Plugin Contributions
    0

    Default Re: Use Of Notifiers - How To

    Quote Originally Posted by DrByte View Post
    Try using this:
    Code:
     $_SESSION['cart']->weight
    $_SESSION['cart']->weight returns what's same as $total_weight.
    Below (within the notifier class' function update), derived from class shipping did the job calculating proper [actual] shipping weight.

    Code:
       function update(&$callingClass, $eventID) { 
           if (!$this->xml_config_switch()) return;
           global $order, $insert_id;
        //Begin Shipping Weight Calculation
        $shipping_weight = $order->total_weight;
        $za_tare_array = split("[:,]" , SHIPPING_BOX_WEIGHT);
           $zc_tare_percent= $za_tare_array[0];
           $zc_tare_weight= $za_tare_array[1];
           $za_large_array = split("[:,]" , SHIPPING_BOX_PADDING);
           $zc_large_percent= $za_large_array[0];
           $zc_large_weight= $za_large_array[1];
        switch (true) {
            // large box add padding
            case(SHIPPING_MAX_WEIGHT <= $shipping_weight):
            $shipping_weight = $shipping_weight + ($shipping_weight*($zc_large_percent/100)) + $zc_large_weight;
            break;
            default:
            // add tare weight < large
            $shipping_weight = $shipping_weight + ($shipping_weight*($zc_tare_percent/100)) + $zc_tare_weight;
            break;
          } //End Shipping Weight Calculation

  3. #3
    Join Date
    Jul 2008
    Location
    Bald Knob, AR
    Posts
    18
    Plugin Contributions
    0

    Default Re: Use Of Notifiers - How To

    I was wondering if anyone has gone any further with this? Such as integrating in with the admin? If not, I guess I'll just have to do it myself.

    Has anyone got this to work on a production site?
    My Zen Cart Store: Outdoor Survival Gear Shop

  4. #4
    Join Date
    Jul 2008
    Location
    Bald Knob, AR
    Posts
    18
    Plugin Contributions
    0

    Default Re: Use Of Notifiers - How To

    I've nearly got that XML generation integrated, but I'm running into one little problem.

    I can write a properly formatted XML file for a particular order, and even write it to a file on my server. How do I then get that file down to the local system which is where Dazzle apparently checks for XML files?

    What I am trying to do is create an automated system, where the admin will just click a button on the order page and an Endicia label will print.

    Any ideas?
    My Zen Cart Store: Outdoor Survival Gear Shop

  5. #5
    Join Date
    Apr 2007
    Location
    Los Angeles, CA
    Posts
    45
    Plugin Contributions
    0

    Default Re: Use Of Notifiers - How To

    Quote Originally Posted by chaoscube View Post
    I've nearly got that XML generation integrated, but I'm running into one little problem.

    I can write a properly formatted XML file for a particular order, and even write it to a file on my server. How do I then get that file down to the local system which is where Dazzle apparently checks for XML files?

    What I am trying to do is create an automated system, where the admin will just click a button on the order page and an Endicia label will print.

    Any ideas?
    Set up an FTP server on your server and use something like NetworkAutomation's Automate, or even a regular FTP clients (not all of them does the job, but some do have scheduling capabilities) to schedule download every .xml files to Dazzle folder.

    I'm using Automate 6.2, which is a great programming tool that costs little less than $1,000 to do lots of other things, too, in addition to a simple scheduled downloading task I mentioned above.

    But all you need is schedule download using a regular FTP client.

    Or compose a batch file that would authenticate, get all files from a specific location, delete from the original location, and schedule it using the windows' Schedule Task found under Control Panel.

    BTW, there is a mod that would generate a packing slip and xml file for Dazzle by me found here: http://www.zen-cart.com/index.php?ma...roducts_id=756

    It's quite incomplete, but you can probably reference it to complete yours.

    Steve.
    www.ToolUSA.com - Hand Tools for Jewelers, Crafters, Garden and Households. Also offers Safety Items and Scout Gadgets.
    www.OfficialCap.com - MLB Licensed Caps by New Era and NFL Licensed Caps by Reebok.

 

 

Similar Threads

  1. Can I use notifiers to assist during product edits/updates?
    By vukan71 in forum General Questions
    Replies: 4
    Last Post: 6 Aug 2012, 04:59 PM
  2. How can I use Multiple mods that use same files?
    By sfklaas in forum General Questions
    Replies: 1
    Last Post: 8 May 2009, 10:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg