• Resolved tonyart

    (@tonyart)


    hello, my shop is built with visual composer, so the feed contains the shortcodes from vc in the product descriptions, how do I remove them?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Algoritmika

    (@algoritmika)

    Hi @tonyart,

    What you need is to set strip_shortcodes as custom_function, i.e.:

    
    <description>[alg_product_description custom_function="strip_shortcodes"]</description>
    
    Thread Starter tonyart

    (@tonyart)

    Thank you for the quick reply, unfortunately it didn’t work, this is what I have:
    <DESCRIPTION><![CDATA[ [alg_product_description custom_function=”strip_shortcodes” use_parent_id=”yes” ]]]></DESCRIPTION>

    I added use_parent_id=”yes” because I need the variation product to take the product main description, otherwise is empty, it takes the description but still with shortcodes for ex:

    <![CDATA[
    [vc_row el_class=”m-b-md”][vc_column][vc_column_text] description of product..
    [/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]”[/vc_column_text][/vc_column][/vc_row]
    ]]>

    Plugin Author Algoritmika

    (@algoritmika)

    @tonyart,

    Hmm… I did try it on my server with my custom [test] shortcode and it did work (i.e. shortcode was removed). Will have to try it with visual composer. Will get back to you asap.

    Thread Starter tonyart

    (@tonyart)

    OK, thank you!

    Thread Starter tonyart

    (@tonyart)

    If it’s not possible, maybe we can use the find and replace functions for multiple items, I tried it and it works for everything beside the [,]. When I want to replace the square brackets, like this <CATEGORYTEXT>[alg_product_description find_replace_sep=”,” find=”[,]” replace=””]</CATEGORYTEXT> the result is <CATEGORYTEXT> ” replace=””</CATEGORYTEXT> so the code thinks the shortcode ends with square bracket from the find=”[,]”.

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @tonyart,

    Hopefully I’ve managed to find a solution. Please update the plugin to the newest v1.5.1 that we’ve just released. Now there I’ve added new strip_shortcodes attribute to all shortcodes. Generally you would need to set it to yes, however, in order to remove visual composer’s shortcodes you need to set it to yes-force (it will then basically remove all that “looks” like shortcodes). I’ve also added new cdata attribute, so your final code should look like this:

    
    <DESCRIPTION>[alg_product_description cdata="yes" strip_shortcodes="yes-force" use_parent_id="yes"]</DESCRIPTION>
    

    Please let me know if it’s still not working as expected.

    And if you like the plugin, please consider leaving me a rating.

    Thread Starter tonyart

    (@tonyart)

    Hello, thank you for the update, but unfortunately did not removed all shortcodes. It looks like only this one was not removed: [vc_column width=”1/6″]. Here is an example result:

    <DESCRIPTION>
    <![CDATA[
    Men’s regular fit training pants is done in several colors….[vc_column width=”1/6″]Delivery within 24 hours[vc_column width=”1/6″]45 days warranty[vc_column width=”1/6″]30 days of return[vc_column width=”1/6″]Free shipping for orders over 250..[vc_column width=”1/6″][vc_column width=”1/6″]
    Phone support..
    ]]>
    </DESCRIPTION>

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @tonyart,

    Ok, please update to plugin v1.5.2 and try it again (same as last time, with strip_shortcodes="yes-force").

    Thread Starter tonyart

    (@tonyart)

    All good now, thank you!

    Plugin Author Algoritmika

    (@algoritmika)

    @tonyart,

    Great! Let me know if you need anything else.

    Thread Starter tonyart

    (@tonyart)

    Yes, I have one more problem for custom taxonomies. They are displayed in alphabetical order in feed, I need them in hierarchical order, from the parent category to the last child.

    • This reply was modified 5 years, 8 months ago by tonyart.
    Plugin Author Algoritmika

    (@algoritmika)

    @tonyart,

    Ok, please update the plugin to v1.5.4. Now you can display product categories in hierarchical order with:

    
    [alg_product_terms taxonomy="product_cat" orderby="hierarchy"]
    

    Please take a look and let me know if something is not working as expected.

    P.S. If you like the plugin, please leave me a rating.

    Thread Starter tonyart

    (@tonyart)

    It’s working, thank you again!

    Plugin Author Algoritmika

    (@algoritmika)

    @tonyart,

    Sure, no problem, happy to help ??

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Remove shortcodes from description’ is closed to new replies.