• Resolved pascalost

    (@pascalost)


    Hi,
    I’m using the shortcode wp_cart_display_product in my archive template as follow:

    do_shortcode(‘[wp_cart_display_product name=’ . $title . ‘ price=’ .$product_price .’ thumbnail=’ . $image . ‘ var1=”Size|Small|Medium|Large”]’)

    Works fine except the $title is truncated. My title is “Title – 123” and it only display everything before the first space uncounted in the string. If I print the $title by itself it works fine. Any idea what is happening here? Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Curious, I see your post is marked “resolved.” What was the solution?

    Thread Starter pascalost

    (@pascalost)

    My code was not done correctly.

    incorrect one:
    do_shortcode(‘[wp_cart_display_product name=’ . $title . ‘ price=’ .$product_price .’ thumbnail=’ . $image . ‘ var1=”Size|Small|Medium|Large”]’)

    good one:
    do_shortcode(“[wp_cart_display_product name=’ $title ‘ price=’ $product_price ‘ thumbnail=’ $image ‘ var1=’Size|Small|Medium|Large’]”)

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_cart_display_product’ is closed to new replies.