[ic] question about custom pricing

Mark Little mlittle13 at yahoo.com
Fri Oct 15 23:51:53 EDT 2004


--- "Ed LaFrance (New Media E.M.S.)" <ic_users at newmediaems.com> wrote:

> At 05:31 PM 9/21/2004, you wrote:
> 
> 
> >--- "Ed LaFrance (New Media E.M.S.)"
> ><ic_users at newmediaems.com> wrote:
> >
> > > At 06:28 PM 9/15/2004, you wrote:
> > >
> > >
> > > >--- "Ed LaFrance (New Media E.M.S.)"
> > > ><ic_users at newmediaems.com> wrote:
> > > >
> > > > > At 10:31 AM 9/14/2004, you wrote:
> > > > >
> > > > > >Sorry for the confusion. Here is my original
> > > post:
> > > > > >
> > > > > >I am setting up a catalog with 4 different
> > > pricing
> > > > > >levels (these values are defined in the
> > > > > product/item
> > > > > >table).
> > > > > >
> > > > > >I can display the price just fine on the
> > > results
> > > > > list
> > > > > >and the item page based on the affiliate's
> > > pricing
> > > > > >level value, but when any item is added to the
> > > > > cart,
> > > > > >it picks up the default 'item-price' value and
> > > not
> > > > > the
> > > > > >affiliate based-price.
> > > > > >
> > > > > >I'm sure this is to protect a malicious user
> > > from
> > > > > >being able to order items at a discount.
> > > > > >
> > > > > >My question is:
> > > > > >Is there a single place where I can put in the
> > > > > price
> > > > > >level checking logic and have an item added to
> > > the
> > > > > >cart w/ the correct price? If not, where do I
> > > need
> > > > > to
> > > > > >make these changes?
> > > > > >
> > > > > >To which you replied:
> > > > > > > > > Mark -
> > > > > > > > >
> > > > > > > > > There are examples of pricing Profiles
> > > in
> > > > > > > > > yourcat/etc/after.cfg; start there.
> > > > > > > > >
> > > > > > > > > - Ed
> > > > > >
> > > > > >I took a look at the file. The desired effect
> > > is to
> > > > > >detect the affiliate ID, and set the
> > > price_level
> > > > > >variable to a value based on the affiliate (1,
> > > 2,
> > > > > 3).
> > > > > >I have columns in my product table called
> > > > > >price_level1,
> > > > > >price_level2, price_level3, price_level4 that
> > > > > contain
> > > > > >the corresponding prices.
> > > > > >
> > > > > >What is the best way to include the logic in
> > > the
> > > > > >after.cfg file? I tried a couple of variants
> > > but
> > > > > >nothing seemed to work correctly. I couldn't
> > > find a
> > > > > >detailed reference or example in the archives.
> > > > > >
> > > > > >Thanks in advance,
> > > > > >Mark
> > > > >
> > > > > You can use ITL in the CommonAdjust string, so
> > > try
> > > > > something like:
> > > > >
> > > > > PriceField      0
> > > > > CommonAdjust    :[scratch aff_price], ;:price,
> > > ;$,
> > > > > ==:options
> > > > >
> > > > > This presumes that you have first set aff_price
> > > in a
> > > > > logical place in the
> > > > > catalog, such as the catalog page you have
> > > > > designated for this affiliate in
> > > > > their 'url' field:
> > > > >
> > > > > [set aff_price][data base=affiliate
> > > > > field=price_level key="@@MV_PAGE@"][/set]
> > > > > [comment] the above assumes that the affiliate
> > > page
> > > > > name matches the key to
> > > > > their affiliate record
> > > > > [/comment]
> > > > > [if scratch aff_price]
> > > > >          [set aff_price]price_level[scratch
> > > > > aff_price][/set]
> > > > > [else]
> > > > >          [set aff_price]price[/set]
> > > > > [/else]
> > > > > [/if]
> > > > >
> > > > > If this is the only kind of pricing stuff you
> > > are
> > > > > doing, you can comment
> > > > > out the include for etc/after.cfg
> > > > >
> > > > > ### include etc/after.cfg
> > > > >
> > > > > ...and just use the PriceField and CommonAdjust
> > > > > directives in catalog.cfg.
> > > > >
> > > > >
> > > >
> > > >Ed:
> > > >
> > > >I have the value for the price_level being set in
> > > the
> > > >top section of my main template that is used for
> > > every
> > > >page (the variable is called affilPrice). It works
> > > >fine. I can see that the value is being set correct
> > > >for price_level and is viewable my results_buylist
> > > >component, etc.
> > > >
> > > >However, using [item-price] in the results_buylist
> > > >component is bringing up the "base" price, and
> > > adding
> > > >an item to the cart results in the same "base"
> > > price
> > > >being used. It is not using what I set in the
> > > >CommonAdjust string...
> > > >
> > > >This is in my catalog.cfg file:
> > > >PriceField      0
> > > >CommonAdjust    :[scratch affilPrice], ;:price, ;$,
> > > >==:options
> > > >
> > > >I'm sure I'm missing something minor..any add'l
> > > help
> > > >would be greatly appreciated!
> > >
> > > Did you comment out or remove 'include
> > > etc/after.cfg'? To comment it out,
> > > you need at least two '#'.  Did you Apply Changes or
> > > restart Interchange?
> > >
> > > If so, put this on any page and see what the output
> > > is:
> > >
> > > [calc] return $Config->{CommonAdjust}; [/calc]
> > >
> > >
> > > - Ed
> > >
> >
> >Ed,
> >I removed the after.cfg reference. Interchange was
> >restarted. Still not showing up, even though I see the
> >price_level is being set correctly in the page output.
> >The [seti] statements that set the price_level are in
> >my leftright template.
> >
> >When I put this in a page:
> >[calc] return $Config->{CommonAdjust}; [/calc]
> >
> >The return is blank.
> >
> >Any further advice would be appreciated!
> >Mark
> 
> That indicates that CommonAdjust is not being set at all, because it should 
> return the CommonAdjust string as set in catalog.cfg. Something is 
> definitely amiss with your config, but I and others can only guess at this 
> point. Did you edit catalog.cfg with a Windows text editor, then upload it? 
> If so, you have carriage return contamination it the file.
> 

Ed,

Finally got a chance to give this a shot. Here is the output for the [calc]
now:
:price_level1, ;:price, ;$, ==:options

So it looks like it is getting set properly.

Only bad news - all prices are showing up as $0.00 across the site!

snippet of bottom of catalog.cfg file:

### WARNING -- if you have an etc/after.cfg file it may override these
settings!
PriceField      0
CommonAdjust    :sale_price, ;:price, ;$, ==:options


## Only search products table by default, don't want returns from any variants
## or other subsidiary ProductsFile
Variable MV_DEFAULT_SEARCH_TABLE products
Variable MV_DEFAULT_SEARCH_FILE  products

## Set which tables can contain products for order
ProductFiles   products

### WARNING -- look below Some of the above definitions -- typically
### ProductFiles, Profile, CommonAdjust, OptionType, and other product-
### based definitions -- are re-set in the next included file.

#==========================================================================#

# Allow a template to drop in some ending config.
######include etc/after.cfg

#==========================================================================#



Any help from here would be greatly appreciated!

Thanks,
Mark



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com


More information about the interchange-users mailing list