views:

118

answers:

3

Hi all ive looked through the current related questions but have not managed to find anything similar to my needs.

Im in the process of creating a affiliate store using zencart - now one of the issues is that zencart is not designed for redirects and affiliate stores but it can be done. I will be changing the store so it acts like a showcase store showing prices.

There is a mod called easy populate which allows me to upload datafeeds. This is all well and good however my affiliate link will not be in each product. I can do it manually after uploading the data feed and going to each product and then adding it as an image with a redirect link - However when there are over 500 items its going to be a long repetitive and time consuming job.

I have been told that I can add the links to the data feed before uploading it to zencart and this should be done using python. Ive been reading about python for several days now and feel im looking for the wrong things. I was wondering if someone could please advise the simplest way for me to get this done.

I hope the question makes sense

thanks

abs

+2  A: 

You could craft a python script using csv module like this:

>>> import csv
>>> cartWriter = csv.writer(open('yourcart.csv', 'wb'))
>>> cartWriter.writerow(['Product', 'yourinfo', 'yourlink'])

You need to know how link should be formatted hoping that it could be composed using the other parameters present on csv file.

systempuntoout
im still waiting to recieve the csv but I will need to add it in a format so that zencart will pick it up. i have a sample file of what i should be aiming for which came with the easy populate module.But i dont know how to upload it here so i will give a link. it can be downloaded from here http://buycheaplcdtvs.com/Full-EP2010Mar27-0707.csv please note that there is no data in the file however it has all the categories needed - hope this is what you are asking for thanks
abs
A: 

First, use the CSV module as systempuntoout told you, secondly, you will want to change your header to:

mimetype='text/csv'
Content-Disposition = 'attachment; filename=name_of_your_file.csv'

The way to do it depends very much of your website implementation. In pure Python you would probably do that with an HttpResponse object. In django, as well, but there are some shortcuts.

You can find a video demonstrating how to create CSV files with Python on showmedo. It's not free however.

Now, to provide a link to download the CSV, this depends of your Website. What is the technology behinds it : pure Python, Django, Pylons, Tubogear ?

If you can't answer the question, you should ask your boss a training about your infrastructure before trying to make change to it.

e-satis
wow - sounds so technical - i dont think i will be able to do it- i didnt understand what you guys are saying but i guess thats because im a total newbie to python -would there be any video tutorials you could point me to
abs
Yes, programming is technical, that's why this website is full of questions :-) Added a link to a video in the question.
e-satis
A: 

Hi - Im not sure what your refering to about the infrastructure but maybe if i explain a little more then it may clear things up. I am using a shopping cart called zencart - ive been using zencart for over a year now and I can make reasonable changes and customizations to it. Of course many things can be done as it ses php - javascript - css- html and god knows what else. Ive only ever really played around with the customization of the look which means the css side - I know html and have made a few changes to the php coding but only with advise.

TBH I dont know if python is the best way for me to go with what I need to do. I dont really want to learn advanced methods as i dont think i will ever need them (I may be wrong) All i want to do at the moment is add a csv data feed to my zencart store which i am able to do. However as I will be using a affiliate datafeed I will need to add my affiliate code to each product. The products are many so it will take much time and I can see myself using this method on many occasions so in all honesty I really need to find a more effienct way of getting this done rather then adding the code to each product manually from within the store. I have been advised that I should use python but im a total novice to programming.

Ive read some tutorials and have been introduced to the command prompt - data - variables and so on- I understand that these are the bases and will need to read them - However when i do a search to look for what i am doing I dont find anything on topic. Im sure im searching for the wrong things and I believe this is due to the fact that I honestly dont have a clue where to start. Im sure if i stick at the tutorials then I will eventually figure it out however I would love to know if there is a place i can go and find out what to do without learning all areas - but instead read about what is on topic for my needs.

Maybe you could recomend a easier way to get this done through excel which will not have such a long learning frame or maybe another programme I will await your reply before i go and purchase the tutorial noted above

thanks

abs