assign xml import feed to a Store.

WordPress Business Themes Forums Version 7 Themes CouponPress assign xml import feed to a Store.

assign xml import feed to a Store.

July 25, 2013
Mark Mark
  • Mark
    Mark
    Newbie 12 points

    Does anyone know how to assign a tanonomy to the xml import feed.

    For example I have a feed from an advertiser called MyShop and in the taxonomy ‘stores’ I have a store called MyShop.

    I want yo import all these feed items to the default ‘Category’ and also assign them to ‘MyShop.

    July 25, 2013 at 1:54 pm
  • Mark
    Mark
    Newbie 12 points

    Bump.. this has got to be a common question…

    July 26, 2013 at 12:21 pm
  • Richard Bonk
    Richard Bonk
    Super Guru 2,739 points

    It depends on the import file and how are you mapping it. If you have a field for ‘category’ and another field for ‘store’ for each coupon, those coupons will get assigned to those categories/stores on import. So for example if you have those fields in the feed and have three coupons A, B and C, and for the coupon A the value of ‘category’ is ‘shopping’ and the value of ‘store’ is ‘MyShop’, for coupon B the value of ‘category’ is ‘electronics’ and the ‘store’ is ‘Sony’ and for the coupon C the value of ‘category’ is ‘shoes’ and the ‘store’ is ‘Nike’ – these coupons will get assigned to the respective categories / stores. Even if all the coupons are from the same store or belong to the same category, in order to get the assigned, you need to populate the ‘category’ and ‘store’ fields for each of them.

    Kind regards,

    Richard

    July 26, 2013 at 9:01 pm
  • Mark
    Mark
    Newbie 12 points

    Hi Richard, Thanks for the response.

    I added ‘store’ and ‘category’ to the xml feed,

    The builtin xml feed import takes them both as [new custom field – save as new]

    so after an import I can see both as custom fields when I edit the coupons.

    both this ‘category’ item and the ‘store’ item name match case sensitive with existing categories and the store item.

    However the are not assigned to the category or store on import.

    Hope you can help

    July 26, 2013 at 11:22 pm
  • Richard Bonk
    Richard Bonk
    Super Guru 2,739 points

    Can you provide an example of the xml feed?

    July 26, 2013 at 11:37 pm
  • Mark
    Mark
    Newbie 12 points

    Hi Richard,

    Sure np, this is the first item:


    <response message="OK" code="0">
    <item>
    <merchant>MyVitamins</merchant>
    <store>MyVitamins</store>
    <category>Sports and Fitnesss</category>
    <mid>1234</mid>
    <ccode>SPORT1</ccode>
    <description>Extra 20% off Sports Vitamins from MyVitamins</description><title>Extra 20% off Sports Vitamins from MyVitamins</title>
    <url>http://www.affiliate.com/cread.php?v=4454&t=xxxxxx&p=http://www.myvitamins.com/offers/sports-vitamins.list</url>
    <start_date>2013-07-26 00:00:00</start_date>
    <end_date>2013-07-31 23:59:59</end_date>
    <merchanturl>http://www.myvitamins.com</merchanturl>
    </item>

    Thanks and regards

    Mark

    July 26, 2013 at 11:42 pm
  • Richard Bonk
    Richard Bonk
    Super Guru 2,739 points

    Are you mapping the fields ‘category’ to category and the ‘stores’ to stores?

    July 28, 2013 at 8:49 am
  • Mark
    Mark
    Newbie 12 points

    Hi Richard, yes yes yes

    Attachments:
    You must be logged in to view attached files.
    July 28, 2013 at 9:29 am
  • Richard Bonk
    Richard Bonk
    Super Guru 2,739 points

    You are mapping it wrong. You have to map it to taxonomy store and not to customfield.

    July 28, 2013 at 10:02 am
  • Mark
    Mark
    Newbie 12 points

    Hi Richard,

    I know that stores is a taxonomy, but there is no option to map to a ‘taxonomy store” that is the reason for this post.

    I could add this to make it default but as far as I can see the array is seen as the same for both default and custom

    $selectArray['store'] = "Post Default - Store";.

    What would I need to add to allow this mapping please.

    Thanks

    Mark

    July 28, 2013 at 10:17 am
  • Richard Bonk
    Richard Bonk
    Super Guru 2,739 points

    Have you tried the ‘Post Deafult – Store’ ? As this seems to be the right option.

    July 28, 2013 at 10:21 am
  • Mark
    Mark
    Newbie 12 points

    Richard,

    You say “As this seems to be the right option.”

    Is this working for you?

    Can you import an xml feed and assign it to a store taxonomy?

    You know “Post Default – Store” is not a provided default option, right.

    This is an edit I made to the feed php file.

    If you got this working please let me know exactly what you did.

    Many thanks

    Mark

    July 28, 2013 at 11:10 am
  • Mark
    Mark
    Newbie 12 points

    It’s just not working for me…

    Attachments:
    You must be logged in to view attached files.
    July 28, 2013 at 11:25 am
  • Mark
    Mark
    Newbie 12 points

    I tried a new install and it is the same.

    If I define a Default post type, it is there to select until an import, then it reverts to a custom post type. The store is then filed in the postmeta table as metakey ‘store’ metavalue ‘myvitamins’ so this method can not be used to to assign a taxonomy store unless there is some code to write it back into ?term_taxonomy ? i guess.

    I had hair when I started this.

    July 28, 2013 at 4:12 pm
  • Mark
    Mark
    Newbie 12 points

    Richard were you pulling my chain here!!

    I just had three coders look at this – the first two failed to get this working and the third needed to edit three files before we could load the feed into associated stores.

    July 29, 2013 at 8:50 pm
Viewing 15 posts - 1 through 15 (of 19 total)

Didn't find what you were after?

Chat with us now

or contact our support team