Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[mv] CommonAdjust 3.14->4.03 woes and hints



******    message to minivend-users from cfm@maine.com     ******


Re CommonAdjust and mv3.14 -> 4.03 conversion:

I got beat up pretty badly today converting a catalog to 4.03
because of my confusion about CommonAdjust.  Maybe this will help
someone else.

--

This worked fine with a bit of tweaking to tag_calc in 3.14 catalogs:

CommonAdjust    &{Vend::CFM::group_price();} , ;specials:price:, ;products:price:, &{MV::ClientPricing::bulk();}

Now in 4.03, the CommonAdjust string does not come into play at all 
because of this in Data.pm::item_price

        $price = database_field($base, $item->{code}, $Vend::Cfg->{PriceField})
                if $Vend::Cfg->{PriceField};
        $price = chain_cost($item,$price || $Vend::Cfg->{CommonAdjust});

When the item appears in chain_cost it has a price so chain_cost
returns immediately.

sub chain_cost {
        my ($item, $raw) = @_;
        ::logGlobal("Starting chain_cost ($item,$raw)");

        return $raw if $raw =~ /^[\d.]*$/;

The implication is that one must null or set to zero the price
to use the vanilla commonadjust string.  That didn't make any sense to
me on the face of it, since one has to start with some price somewhere.

So if I set PriceField to "left_field" :^) in catalog.cfg:
# catalog.cfg
PriceField left_field

it works.  I don't like it much, someone else might easily come along
and "fix" it.

	# This might or might not be a work around
	# Note that we are still converting to 4.03 and this may
	# be entirely irrelevant in later versions.
	unless ($Vend::Cfg->{CommonAdjust}) {
	        $price = database_field($base, $item->{code}, $Vend::Cfg->{PriceField})
        	        if $Vend::Cfg->{PriceField};
	}
        $price = chain_cost($item,$price || $Vend::Cfg->{CommonAdjust});


-- 

Christopher F. Miller, Publisher                             cfm@maine.com
MaineStreet Communications, Inc         208 Portland Road, Gray, ME  04039
1.207.657.5078                                       http://www.maine.com/
Database publishing, e-commerce, office/internet integration, Debian linux.
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: