• Resolved HCVNI

    (@hcvni)


    Hi guys,
    I have been using your plugin for ages and it is first class, it saves me so much time.
    I am trying to automate even further now, but have been putting this bit off for ages.

    I import discount codes, some are percentage, some are monetary, some are neither.
    Can I set the Product Attribute depending on what is in the Discount field in the import?

    For example, if the discount field contains $xx, set the Attribute to Money off, if it contains XX%, set it to Percent off. If it contains neither, set it to Special Offer. I suppose that’s 3 IFs actually.

    I hope that makes sense?

    Any help appreciated, it would save me a lot of trial-and-error.

    Thank you in advance.

    https://wordpress.org/plugins/wp-all-import/

Viewing 1 replies (of 1 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi HCVNI.

    It’s usually much easier to use a custom PHP function for something like this. We have information on that here: http://www.wpallimport.com/documentation/advanced/execute-php/

    If you would rather use an IF statement, then something like this would work:

    [IF({discount[1][contains(.,'$xx')]})]Money off[ELSEIF({producttitle[1][contains(.,'XX%')]})]Percent off[ELSE]Special Offer[ENDIF]

    Be sure to replace the elements (discount and producttitle) with the ones from your import feed.

Viewing 1 replies (of 1 total)
  • The topic ‘Can I have 2 Ifs and a Contains?’ is closed to new replies.