Interchange

CVS log for interchange/lib/Vend/Ship.pm

[BACK] Up to [Local Repository] / interchange / lib / Vend

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 2.29: download - view: text, markup, annotated - select for diffs
Wed Nov 5 22:38:52 2008 UTC (2 months ago) by mheins
Branches: MAIN
CVS tags: REL_5_7_1, HEAD
Diff to: previous 2.28: preferred, colored
Changes since revision 2.28: +4 -2 lines
* Fix problem with new-style shipping configuration reading a mixed-case
  option.

Revision 2.28: download - view: text, markup, annotated - select for diffs
Fri Apr 11 08:44:20 2008 UTC (8 months, 4 weeks ago) by danb
Branches: MAIN
CVS tags: STABLE_5_6-root, STABLE_5_6-branch, REL_5_6_1, REL_5_5_3, REL_5_5_2, DEB_5_6_1_2
Diff to: previous 2.27: preferred, colored
Changes since revision 2.27: +12 -0 lines
Allow the shipping.asc weight to be modified with weight_callout SpecialSub.

This SpecialSub modifies the 'weight' criteria in shipping.asc. It does not
affect other calculations, such as the [weight] usertag. In the following
example, it is used to exclude items that are part of a free shipping
promotion from the calculation of the shipping cost. That is, if two out of
three items qualify for free shipping, then only the weight of the third
item would be used for weight-based shipping methods.

# Override the normal shipping.asc weight calculations to take the free
# shipping promotion into consideration. Uses custom is_free_shipping and
# weight Item Modifiers. Only non-free-shipping items have their weight
# included.
Sub custom_weight <<EOF
sub {
    my ($normal_weight) = @_;

    my $new_weight = 0;
    for my $item (@$Items) {
        $new_weight += $item->{weight} * $item->{quantity}
            unless $item->{is_free_shipping};
    }
    return $new_weight;
}
EOF
SpecialSub weight_callout custom_weight

Revision 2.27: download - view: text, markup, annotated - select for diffs
Fri Apr 11 07:47:16 2008 UTC (8 months, 4 weeks ago) by danb
Branches: MAIN
Diff to: previous 2.26: preferred, colored
Changes since revision 2.26: +12 -2 lines
Augment shipping.asc with shipping_callout SpecialSub.

This change allows you to call another function after the normal shipping
has been calculated, but before the result is returned. It's useful for
the type of customization that would require modifying too many shipping
table entries or using entirely custom shipping code, because it allows
you to build on the powerful shipping features interchange already has.
It is backwards-compatible. For example:

# Calculate shipping as normal with shipping.asc, then apply a discount
# for dealers using UPS shipping methods.
Sub custom_shipping <<EOF
sub {
        my ($final, $mode, $opt, $o) = @_;
        $final *= .90 if $Scratch->{dealer} and $mode =~ /UPS/i;
        return $final;
}
EOF
SpecialSub shipping_callout custom_shipping

Revision 2.26: download - view: text, markup, annotated - select for diffs
Thu Aug 9 13:40:54 2007 UTC (17 months ago) by pajamian
Branches: MAIN
CVS tags: REL_5_5_1, DEB_5_5_1_1_1, DEB_5_5_1
Diff to: previous 2.25: preferred, colored
Changes since revision 2.25: +2 -2 lines
* Updated copyright headers to 2007 (closes bug #102)

* Added GPL and copyright headers to a few files that were missing them.

Revision 2.25: download - view: text, markup, annotated - select for diffs
Sun Aug 5 12:57:48 2007 UTC (17 months ago) by pajamian
Branches: MAIN
Diff to: previous 2.24: preferred, colored
Changes since revision 2.24: +13 -16 lines
More shipping code cleanup

Revision 2.24: download - view: text, markup, annotated - select for diffs
Sat Aug 4 12:40:31 2007 UTC (17 months ago) by pajamian
Branches: MAIN
Diff to: previous 2.23: preferred, colored
Changes since revision 2.23: +25 -40 lines
The new Ship.pm seems to have a lot of problems.  Here is a patch which
addresses the following issues:

* Fixed problem where only the last shipping policy will get stored if
the multi-line format is used in shipping.asc.

* Fixed problem where options are not converted and stored properly on
all shipping policies.

* Moved more code into the new process_new_beginning sub:
	* By passing a ref to the @shipping array I can now push new records
onto the array from inside the sub.
	* The above means that the old @list array need not be returned since
it's only purpose at that point was to push the record onto @shipping,
then immediately be overwritten by @new.
	* That also means that @new can be assigned to @list inside the sub
instead of outside it.
	* Since we no longer need to return @new, this frees up the return
value which I have used to return the $first value instead.
	* Because $first is returned we no longer need to flag that condition
by assigning "_newmode" as the shipping mode.

* I also removed an entire redundant elsif branch from read_shipping.
The regexp that the branch tested for would never cause the branch to be
executed because the branch above it tests for a regexp that matches the
same lines.

I don't think it's a big deal to change the process_new_beginning sub
the way I did because the sub itself is only about 5 weeks old, so the
likelyhood of someone having implemented code around it is extremely small.

Revision 2.23: download - view: text, markup, annotated - select for diffs
Wed Jul 4 16:40:51 2007 UTC (18 months ago) by mheins
Branches: MAIN
Diff to: previous 2.22: preferred, colored
Changes since revision 2.22: +10 -4 lines
* Fix shipping line processing bug that put an extra mode at beginning
  of mode array.

Revision 2.22: download - view: text, markup, annotated - select for diffs
Mon Jun 25 16:26:43 2007 UTC (18 months, 2 weeks ago) by mheins
Branches: MAIN
Diff to: previous 2.21: preferred, colored
Changes since revision 2.21: +54 -15 lines
* Change [shipping-desc] to allow access to arbitrary keys in the shipping
  configuration.

* Adds key parameter so that you can access any member of the initial shipping
  hash for a mode. You can see things like zone, aggregate, adder, etc. as
  well as any arbitrary keys you set.

* Allows something like:

	usps: USPS 1st class
		crit        [onlyitems]
        min         0
        max         0
        cost        e No shipping needed!
        at_least    0
        adder       0
        p_time      1-2 business days
        s_time      3-7 business days
        foo         bar

        min         1
        max         6
        cost        4.00

        min         7
        max         12
        cost        7.00

        [loop list="[shipping possible=1]"]
                Shipping Mode:   [shipping-desc mode="[loop-code]"]
                Processing time: [shipping-desc mode="[loop-code]" key=p_time]
                Shipping time:   [shipping-desc mode="[loop-code]" key=s_time]
                Cost:            [shipping mode="[loop-code]"]
        [/loop]

* Thanks to Paul Jordan for suggesting and supporting this!

Revision 2.13.2.4: download - view: text, markup, annotated - select for diffs
Fri Mar 30 12:15:29 2007 UTC (21 months, 1 week ago) by pajamian
Branches: STABLE_5_4-branch
CVS tags: REL_5_4_3
Diff to: previous 2.13.2.3: preferred, colored; branchpoint 2.13: preferred, colored; next MAIN 2.14: preferred, colored
Changes since revision 2.13.2.3: +3 -3 lines
New Free Software Foundation Address in headers of various files

Revision 2.21: download - view: text, markup, annotated - select for diffs
Fri Mar 30 11:39:46 2007 UTC (21 months, 1 week ago) by pajamian
Branches: MAIN
Diff to: previous 2.20: preferred, colored
Changes since revision 2.20: +3 -3 lines
New Free Software Foundation Address in headers of various files

Revision 2.20: download - view: text, markup, annotated - select for diffs
Wed Feb 14 05:24:03 2007 UTC (22 months, 3 weeks ago) by jon
Branches: MAIN
Diff to: previous 2.19: preferred, colored
Changes since revision 2.19: +2 -2 lines
Stop the [shipping] tag from setting mv_shipmode behind your back,
even if you have no_set in your [shipping] tag's options, because
the options are not carried forward into each possible invocation of
resolve_shipping().

Patch from Jeff Boes <jeff@endpoint.com>.

Revision 2.13.2.3: download - view: text, markup, annotated - select for diffs
Wed Sep 20 12:33:42 2006 UTC (2 years, 3 months ago) by kwalsh
Branches: STABLE_5_4-branch
CVS tags: REL_5_4_2
Diff to: previous 2.13.2.2: preferred, colored; branchpoint 2.13: preferred, colored
Changes since revision 2.13.2.2: +2 -2 lines
    * Autovivification issue: The temporary mv_shipping cart was left
      undefined instead of being removed in some cases.  In fact, in the
      test case that showed the error, the mv_shipping cart was just being
      defined as undef and left as-is.  The undef "cart" caused problems
      in later cart recalculations.
      (back-ported from CVS HEAD)

Revision 2.19: download - view: text, markup, annotated - select for diffs
Thu Aug 24 20:57:25 2006 UTC (2 years, 4 months ago) by kwalsh
Branches: MAIN
Diff to: previous 2.18: preferred, colored
Changes since revision 2.18: +2 -2 lines
    * Autovivification issue: The temporary mv_shipping cart was left
      undefined instead of being removed in some cases.  In fact, in the
      test case that showed the error, the mv_shipping cart was just being
      defined as undef and left as-is.  The undef "cart" caused problems
      in later cart recalculations.

Revision 2.18: download - view: text, markup, annotated - select for diffs
Wed Apr 5 14:42:19 2006 UTC (2 years, 9 months ago) by mheins
Branches: MAIN
Diff to: previous 2.17: preferred, colored
Changes since revision 2.17: +2 -2 lines
* Add lockout to list of SpecialSub routines allowed.

* If user-configured lockout routine returns true, it replaces the
  current routine completely. If it returns false, the normal one
  is run as well.

* Move the logging out of Vend::Dispatch to the do_lockout routine, so
  that you can avoid the log entry if your user-configured routine handles
  the lockout.

* Make the number of seconds for robot reset adjustable from its
  current hardcoded 30:

  	Limit   lockout_reset_seconds

  Maybe that should be robot_reset_seconds, I don't know.

* Change use of $Vend::Cfg->{Limit}{member} to $::Limit->{member}. As
  Limit is used in iterative routines like chain_cost, this should
  improve performance.

Revision 2.17: download - view: text, markup, annotated - select for diffs
Fri Feb 3 16:42:48 2006 UTC (2 years, 11 months ago) by ton
Branches: MAIN
Diff to: previous 2.16: preferred, colored
Changes since revision 2.16: +3 -2 lines
	Accidently nutralized part of Mike's previous commit.

Revision 2.16: download - view: text, markup, annotated - select for diffs
Fri Feb 3 16:36:45 2006 UTC (2 years, 11 months ago) by ton
Branches: MAIN
Diff to: previous 2.15: preferred, colored
Changes since revision 2.15: +28 -4 lines
	Added UPS support for countries ouside the US.

	In order to use this functionality one only needs
	to add the following two lines to a UPS shipping
	method in shipping.asc.

	zone_file	products/ship/zone_NL_international.txt
	country_prefix	1

	The zone file 'zone_NLinternational.txt' is TAB delimited and
	should contain entries like:


	low	high	ExpressPlus	Express	ExpressSaver	Standard	Expedited

	"Destination: Belgium (BE). 4-digit code"
	BE:0000	BE:9999	2	2	2	2	-

	"Destination: France (FR). 5-digit code"
	FR:2000	FR:2999	3	3	3	4	-
	FR:3000	FR:7999	3	4	4	5	-
	FR:8000	FR:8999	3	3	3	4	-
	FR:9000	FR:9999	3	4	4	5	-
	FR:1000	FR:1099	3	3	3	4	-


	The values in the postcode range should be prepended with the
	country code. Prepend FR: to postcodes for country France.

	There is no change to the rate tables.

Revision 2.13.2.2: download - view: text, markup, annotated - select for diffs
Fri Feb 3 15:35:36 2006 UTC (2 years, 11 months ago) by mheins
Branches: STABLE_5_4-branch
CVS tags: REL_5_4_1
Diff to: previous 2.13.2.1: preferred, colored; branchpoint 2.13: preferred, colored
Changes since revision 2.13.2.1: +5 -2 lines
* Make log message manageable with ErrorDestination.

* Allow a "quiet" shipmode that won't log missing areas.

Revision 2.15: download - view: text, markup, annotated - select for diffs
Fri Feb 3 15:34:32 2006 UTC (2 years, 11 months ago) by mheins
Branches: MAIN
Diff to: previous 2.14: preferred, colored
Changes since revision 2.14: +5 -2 lines
* Make log message manageable with ErrorDestination.

* Allow a "quiet" shipmode that won't log missing areas.

Revision 2.13.2.1: download - view: text, markup, annotated - select for diffs
Wed Jan 18 17:48:17 2006 UTC (2 years, 11 months ago) by mheins
Branches: STABLE_5_4-branch
Diff to: previous 2.13: preferred, colored
Changes since revision 2.13: +12 -5 lines
* Fix thread-safety problem with shipping adder (and potentially other
  things).

Revision 2.14: download - view: text, markup, annotated - select for diffs
Wed Jan 18 17:47:14 2006 UTC (2 years, 11 months ago) by mheins
Branches: MAIN
Diff to: previous 2.13: preferred, colored
Changes since revision 2.13: +12 -5 lines
* Fix thread-safety problem with shipping adder (and potentially other
  things).

Revision 2.13: download - view: text, markup, annotated - select for diffs
Thu Jun 9 18:43:58 2005 UTC (3 years, 7 months ago) by docelic
Branches: MAIN
CVS tags: STABLE_5_4-root, REL_5_4_0, REL_5_3_3, REL_5_3_2, DEB_5_3_0_20051028_1, DEB_5_3_0_20051004_1
Branch point for: STABLE_5_4-branch
Diff to: previous 2.12: preferred, colored
Changes since revision 2.12: +2 -2 lines
- XHTML-compliance:

  - lowercased/quoted HTML tags (all containers, so no ">" vs. "/>" issues)

Revision 2.12: download - view: text, markup, annotated - select for diffs
Sat Apr 30 14:52:55 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.11: preferred, colored
Changes since revision 2.11: +11 -6 lines
* Incorporate "use strict" for this module.

* Improve handling of ship_message.

* Avoid some warnings.

Revision 2.11: download - view: text, markup, annotated - select for diffs
Thu Apr 28 01:54:44 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.10: preferred, colored
Changes since revision 2.10: +4 -3 lines

* Various variable initializations and tests to avoid warnings.

Revision 2.10: download - view: text, markup, annotated - select for diffs
Tue Jan 25 17:47:45 2005 UTC (3 years, 11 months ago) by jon
Branches: MAIN
Diff to: previous 2.9: preferred, colored
Changes since revision 2.9: +6 -7 lines
Make $Session->{ship_message} consistently have a ' ' separator between
messages added to it. (Most places already did this correctly.)

It seems it would be nicer to have an array of shipping messages, but
doing that now would introduce lots of compatibility problems.

Also don't check $Session->{shipping_error}, which seems to be a bug, as
that is never used elsewhere and doesn't make sense in this context.

Revision 2.9: download - view: text, markup, annotated - select for diffs
Sat Oct 2 22:21:49 2004 UTC (4 years, 3 months ago) by jon
Branches: MAIN
Diff to: previous 2.8: preferred, colored
Changes since revision 2.8: +3 -2 lines
Allow variable and ITL interpolation in the "free" shipping argument.

Since existing installations will have been using either undef/'' or '1',
this won't slow them down, but it does allow more advanced free shipping
logic, such as (in multi-line shipping.asc notation):

free [if session something]1[/if]

Or in older single-line notation:

{ free => '[if session something]1[/if]' }

Revision 2.8: download - view: text, markup, annotated - select for diffs
Mon Jul 5 21:59:56 2004 UTC (4 years, 6 months ago) by mheins
Branches: MAIN
Diff to: previous 2.7: preferred, colored
Changes since revision 2.7: +2 -1 lines
* Add @@CRIT@@ marker to cost area.

Revision 2.7: download - view: text, markup, annotated - select for diffs
Mon Jul 5 21:46:33 2004 UTC (4 years, 6 months ago) by mheins
Branches: MAIN
Diff to: previous 2.6: preferred, colored
Changes since revision 2.6: +2 -1 lines
* Give access to the accumulated criteria with @@CRIT@@ in the "adder".
  It is a macro substitution as in @@TOTAL@@ (which gives access to the
  otherwise-final calculated shipping cost.

  This is a bit confusing, as @@TOTAL@@ gives access to the accumulated
  criteria in the "cost" area. We probably should add @@CRIT@@ there
  too.

Revision 2.6: download - view: text, markup, annotated - select for diffs
Fri Apr 9 03:18:55 2004 UTC (4 years, 9 months ago) by mheins
Branches: MAIN
Diff to: previous 2.5: preferred, colored
Changes since revision 2.5: +17 -2 lines
* Add source_kg, source_oz, and source_grams option for internal
  UPS -- makes match the Ship::Postal module.

* Add packaging_weight option to add a fixed (or variable when passed
  by parameter) packaging weight when appropriate.

Revision 2.5: download - view: text, markup, annotated - select for diffs
Fri Sep 12 19:45:49 2003 UTC (5 years, 3 months ago) by jon
Branches: MAIN
CVS tags: STABLE_5_2-root, STABLE_5_2-branch, STABLE_5_0-root, STABLE_5_0-branch, REL_5_2_1, REL_5_2_0, REL_5_1_1, REL_5_1_0, REL_5_0_2, REL_5_0_1, REL_5_0_0_RC2, REL_5_0_0_RC1, REL_5_0_0, REL_4_9_9, DEB_5_2_1_1, DEB_5_0_0_2, DEB_4_9_8_20031014_1, DEB_4_9_8_20031010_1
Diff to: previous 2.4: preferred, colored
Changes since revision 2.4: +2 -2 lines
Allow comment lines in shipping.asc, with leading # mark.

Revision 2.4: download - view: text, markup, annotated - select for diffs
Tue Aug 19 15:24:47 2003 UTC (5 years, 4 months ago) by jon
Branches: MAIN
CVS tags: DEB_4_9_8_20030911_1
Diff to: previous 2.3: preferred, colored
Changes since revision 2.3: +2 -2 lines
Add hide_error option to suppress error message when no shipping methods
are found.

Revision 2.3: download - view: text, markup, annotated - select for diffs
Wed Jun 18 17:34:44 2003 UTC (5 years, 6 months ago) by jon
Branches: MAIN
CVS tags: REL_4_9_8, DEB_4_9_8_20030706_1, DEB_4_9_8_2
Diff to: previous 2.2: preferred, colored
Changes since revision 2.2: +3 -2 lines
The great copyright, email address, URL, and version update.

Revision 2.2: download - view: text, markup, annotated - select for diffs
Wed May 14 22:29:29 2003 UTC (5 years, 7 months ago) by mheins
Branches: MAIN
Diff to: previous 2.1: preferred, colored
Changes since revision 2.1: +43 -9 lines
* Allow relocation of all shipping files with:

	Shipping default directory products/ship

* Update MySQL for 3.23/4.x and transactions (Foundation)

* Add Vend::Ship::QueryUPS and Vend::Ship::Postal modules with
  docs.

* Fix bug in UPS query caching.

* Allow update_order_status to actually send email.

Revision 2.1: download - view: text, markup, annotated - select for diffs
Tue May 13 19:05:18 2003 UTC (5 years, 7 months ago) by mheins
Branches: MAIN
* Break out shipping stuff from Vend::Interpolate. Add stubs so
  custom code doesn't break.

* Add ability to put custom shipping modules in, called with
  "cost" field of "s Module".

* Improve [ups-query ...] to aggregate shipments and cache prior
  lookups.

* Document [ups-query].

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

Interchange CVSweb <info@icdevgroup.org>