ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Export CSV from store channel

June 06, 2014 2:38pm

Subscribe [2]
  • #1 / Jun 06, 2014 2:38pm

    blaiseymae

    108 posts

    Hoping someone can help.

    I am using AJW export to generate a CSV file that I can use to populate a store. 

    It is generating the file, but I can’t seem to get it to spit out the image url, or the category.  AND it is including way more info than I need.  The product title, description, price, and photo (with url to image) and category is the only information required.

    Any ideas are appreciated.

    {exp:ajw_export
    sql="SELECT category, title, product_description, product_price, product_photo"
    channel="products"
    format="csv"
    delimter=":"
    filename="shop.csv"
    }

    Here is a link to the CSV file it is outputting for reference.

    CSV file

    Thanks, in advance.

  • #2 / Jun 08, 2014 12:16pm

    Rob Allen

    3105 posts

    I suspect your sql query may not be correct so ajw_export is simply pulling out all data for those channel entries.

    You could ask brandnewbox.co.uk for help, or you could do it another way - here’s how I get CSV out quickly

    1. Create a template somewhere in EE, call it export, so you may have it in say site/export

    2. Add just a channel entries tag for your product data and add the fields you want to collect, eg

    {exp:channel:entries channel="products" limit="99999"}
    "title"|"description"|"price"|"image"|"category"
    
    "{title}"|"{description_field}"|"{price_field}"|"{image_field}"|"{categories limit="1"}{category_name}{/categories}"
    
    {/exp:channel:entries}

    Set the limit high enough to get all your entries out if you have more than 100
    You can change the pipe “|” delimiter to whatever you want, I use pipe because it doesn’t interfere with other regularly used characters.

    Now open up the template at http://www.yoursite.com/index.php/site/export , copy the page content, paste it into a text editor and save the file.

     

     

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases