• Resolved lyonbeton

    (@lyonbeton)


    Hello,

    I use WP All Import to import woocommerce products informations on my website from a CSV file.
    It works pretty well until I try to make it work with Members plugin and its shortcodes.

    In the excerpt field of the product, I want to have some content displayed only for certain user roles.
    So I add a shortcode in my import settings in the excerpt field, like this :
    <p>[members_access role="administrator,wholesale_europe"]Recommended Retail Price inc. VAT: {recommendedretailpriceincludingvat[1]}?EUR[/members_access]</p><p>{enproductdescription[1]}</p>

    When I try to go to the next step, I’ve this error message :
    “Excerpt template is invalid: Unexpected token COMMA, statement was expected.”
    So I remove one role to eliminate this issue, like this:
    <p>[members_access role="wholesale_europe"]Recommended Retail Price inc. VAT: {recommendedretailpriceincludingvat[1]}?EUR[/members_access]</p><p>{enproductdescription[1]}</p>

    I was able to go to the next step and run the import. But When I go to the front page of the website, I see this in the excerpt area:
    Recommended Retail Price inc. VAT: 119 EUR/members_access]

    View post on imgur.com

    What can I do?
    Thanks.

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

    (@wpallimport)

    Hi @lyonbeton

    In this case, you should escape the shortcodes with backslashes so that WP All Import doesn’t think you’re trying to call PHP functions.

    This code should work fine:

    <p>\[members_access role="administrator,wholesale_europe"]Recommended Retail Price inc. VAT: {recommendedretailpriceincludingvat[1]} EUR\[/members_access]</p><p>{enproductdescription[1]}</p>

    Thread Starter lyonbeton

    (@lyonbeton)

    Thank you for the tips. It’s working just fine !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Import content including Members Plugin Shortcode’ is closed to new replies.