[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
RE: [mv] more efficient cart content display using SQL db
Wow, complicated.
I tried using [item-data product_term our_retail_price] inside
[item-list][/item-list], just like
http://www.minivend.com/minivend/docindex/09.13.Item_Lists.html describes,
to get the value of 'our_retail_price' field from 'product_term' table for
displaying in the shopping cart, but it didn't work :(
Shouldn't it?
[item-field product_name] worked for retrieving 'product_name' value from
'products' table.
Thanks!
Otis
P.S.
Is there documentation, even just partial, describing the SQL setup (tags on
various pages, etc.)? There were a few people who wanted to rewrite the
docs, no? (Brigitte?)
> ****** message to minivend-users from "Mr. Anthony R.J. Ball"
> <ant@maine.com> ******
>
> > I'm wondering if there is a simple/efficient way of retrieving
> information
> > about the product that a user added to the shopping cart for
> displaying in a
> > shopping cart page.
> >
> > The product info that I want to show resides partically in a
> table (MySQL)
> > called 'products' (product_id and product_name are there) and
> partially in
> > another table called product_term (prices are there).
> >
> > I know I could probably use something like this:
> >
> > [if items]
> > [then]
> > [item-list]
> > [sql type=list query="SELECT sub_length, sub_type, sub_newrenew,
> > issues_per_year, sug_retail_price,
> > our_retail_price,special_instructions_for_customers FROM product_term
> > WHERE product_id = '[item-code]'"]
> > ...
> > ...
> >
> > ...but I'm thinking that there may be a better, more efficient way of
> > retrieving product info. Something that wouldn't require that I
> do this SQL
> > SELECT statement again (because the same SQL is done when
> displaying product
> > information using flypage).
>
> heheh... If I were to do this I'd pull down the basket (an
> array of hashes)
> do a single query of all the product codes, and then push this
> info into those
> hashes and put it back to the session. Only doing it again for cart items
> that don't have the info set... however... this is NOT vanilla
> minivend :)
> I don't even think it follows the safe restrictions so you'd have to do it
> with either the realperl tag (from a month or two ago) or with a
> globalsub.
> Either way means overloading Mike's basket.
>
> The other way, which would probably work as well... is to save
> this data
> somewhere in a session hash keyed off the item code. Something like
> $Session{items}{[item-code]} = [ array or hash of interesting info ];
> and then add stuff to the basket printout to read and display this.
>
> Probably the best place to put the cde for this is on the
> basket page just
> above the basket code itself.