Try the Demo

Magento Forum

   
Auto Update Product Prices Using XML Feed
 
arctic_gardener
Jr. Member
 
Total Posts:  2
Joined:  2013-01-29
 

I’m working on a magento shop that sells precious metal coins and bars of different weights. 

The price for each product needs to change with the spot gold price as it changes throughout the trading day.  At the moment I have less than 10 products that require this treatment, but would like to find a solution that can be added to easily.

Example of what I’m aiming for:

Monday at 1pm precious metals are trading on the open market and gold spot is at $1600 per oz.  I’m selling a 1 oz gold coin in my shop that gets its price from this $1600 number and displays to customer: 1 oz gold coin $1650. ($50 added for markup) Now 20 minutes later on Monday, spot gold moves up to $1615 per oz, and my shop automatically changes the price customer sees for this 1 oz gold coin to $1665.

Different products made from gold would all be based on this spot gold number that changes, but would also each have a unique $ amount markup that would be either fixed or percent added.

A calculation to achieve desired result might be:
1oz gold coin price = goldspot * 1 + $50 markup
1/4oz gold coin price = goldspot * 0.25 + $20 markup

It looks like the gold spot price can be acquired through an xml feed that updates every few minutes, but I’m not sure how to apply these updating values to my products.

How can this be accomplished?

If a new product needs to be added, is there a simple way to input the markup and weight for that product and then have the “goldspot” multiplied by the weight + markup = price?

I’m really new to all this, so any help would be greatly appreciated.  Perhaps you could point me in the right direction if this question in part has already been addressed elsewhere.

Thanks so much.

 
Magento Community Magento Community
Magento Community
Magento Community
 
VanquishTech
Sr. Member
 
Avatar
Total Posts:  179
Joined:  2012-11-19
 

Yes, it can be done relatively easily with experience however you will hit problems immediately. Companies spend $100\’s thousands creating automated data feeds, if the volume is low in hundreds then there are easy solutions including flat file loads. You will need to use the API otherwise you will have to reindex constantly causing front and backend issues, direct database updates will not be realible for intra-day updates.

If you are in the thousands of products you need to good hosting to handle the load and an automated tool. Anything in the 10s thousands and you are in the mid to enterprise solutions. We have a drop-in solution for this but it will be too expensive, we suggest you look at API product loads, it is a combination or hosting, changed records, stability, limiting technical changes, balancing update frequency, and others, the combination is very difficult to implement let along keep stable.

 Signature 

Vanquish Technology Division
- http://www.vanquishconsulting.com
-

 
Magento Community Magento Community
Magento Community
Magento Community
 
arctic_gardener
Jr. Member
 
Total Posts:  2
Joined:  2013-01-29
 

Thanks for the reply Vanquish.

At this point, since I have less than 10 products that need prices auto updated throughout the day, I’m still hopeful that I can implement something myself that will work.

One more detail is that I’m dealing with multiple types of metal.  I would like to be able to specify during product creation in the back end which metal price the new product should be associated with, and perhaps even the weight of the product so the price calculation would check these variables and display the appropriate amount.

Product 1
type: gold
weight: 1 troy oz
markup: $50

Product 2
type: silver
weight: 10 troy oz
markup: $19

etc…

Does this make sense?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ryan Sun _Kuafu
Guru
 
Total Posts:  316
Joined:  2008-11-14
FL
 

you will create a cronjob observer and set it to get latest gold price from market(I believe there is a web service) every monday 1pm
then get a collection of products and update price.

 
Magento Community Magento Community
Magento Community
Magento Community
 
arctic_gardener
Jr. Member
 
Total Posts:  2
Joined:  2013-01-29
 
Ryan Sun _Kuafu - 05 March 2013 09:24 PM

you will create a cronjob observer and set it to get latest gold price from market(I believe there is a web service) every monday 1pm
then get a collection of products and update price.

How do I setup a cronjob that will get the gold price from the xml feed?

The XML file looks something like this:

<prices>
<currency access="usd">
<price access="gold">50.91713</price>
<price access="palladium">23.9523</price>
<price access="platinum">51.28044</price>
<price access="silver">0.93205</price>
</currency>
</prices>

Do I assume correctly that the data in this feed will need to be processed somehow before Magento can use it to update product prices?

Thanks for helping on this.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top