[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Script to modify values in database
****** message to minivend-users from Ezra Gilbert <EGilbert@CYBERNEX.NET> ******
The problem is I need actually change the value of each item in my database, for instance say this is my products
database:
products.asc
code title weight price
01 gold ring 13 (13*value_of_gold) <---- I know i can't put that in a
02 gold necklace 22 (22*value_of_gold) <---- database for the price field,
03 gold pendant 17 (17*value_of_gold) <---- but thats essentialy what i
... <---- need
To do what you're saying I'd essentially need a "PriceMultiply" variable set to current value of gold say ... then
i'd set my price field in the database to the weight of the item. So every price _would_ be the
weight*the_current_value_of_gold.
I know it be possible to create a "PriceMultiply" variable in the cfg file but how would I go about getting it to
modify the price of an item?
This method seems to have some promise but I can see I will run into alot of bumps if I do it this way (different
metals have different values so I'd have to split each metal up into its own catalog ... ) If I could write a
script that would physically change the price fields that would be the ideal ...
Thanks for the info Mike,
- Ezra Gilbert
"Webmaster of Infothai CM Co., Ltd." wrote:
> ****** message to minivend-users from "Webmaster of Infothai CM Co., Ltd." <webmaster@infothai.com> ******
>
> I did something similar with exchange rates. I used the "#include" functionality
> in the catalog configuration file to incorporate the contents of the file. The
> file itself contained the exchange rate defined as a Minivend localization
> paramter, e.g.:
>
> Locale en_TH PriceDivide 36.7979
>
> You could do something similar, or simply define your own variable.
>
> Whenever the file is updated, the affected catalog(s) must be restarted.
> Perl can do this by calling the appropriate catalog restart scripts.
>
> Regards,
>
> Mike
>
> On Tue, 20 Apr 1999 21:21:32 -0400, Ezra Gilbert wrote:
>
> >****** message to minivend-users from Ezra Gilbert <EGilbert@CYBERNEX.NET> ******
> >
> >I am working on a jewelry site where the prices are to be based on the current exchange
> >rates of gold & silver. These prices are changed twice a day. Basically, the price of
> >an item is it's weight(a field in the products database) times the current value of
> >whatever metal it is. I have the current values of the metals outputed to files twice a
> >day and I was wondering if anyone had any advice on how I should go about modifying the
> >database. I use tab delimineted databases.
> >
> >I was thinking a Perl script should do the job but I am still quite the novice when it
> >comes to Perl and am not positive it can do the job. If anyone has ever done anything
> >like this or can offer some advice it would be greatly appreciated.
> >
> >Ezra Gilbert
> >
> >-
> >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
> >
>
> webmaster@infothai.com
> http://www.infothai.com
>
> -
> 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
-
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