Premise and Product Description in the Sidebar (just like StudioPress)

Community Forums Forums Design Tips and Tricks Premise and Product Description in the Sidebar (just like StudioPress)

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  hich 1 year ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #77826

    hich
    Participant
    Post count: 16

    Need to use a custom code to add and process the product_description short code so it appears in the “sidebar” of the
    page. I need to add the code using the echo do_shortcode() method so it appears in my sidebar area on the checkout page. Can anybody help me with the code I shall insert?

    #77842

    nutsandbolts
    Keymaster
    Post count: 3202

    Apologies if I’m missing the point or if this isn’t helpful, but you can use shortcodes in widgets by adding the following to functions.php:

    // Enable shortcodes in widgets
    add_filter('widget_text', 'do_shortcode');

    And you can allow PHP in widgets with this function:

    // Enable PHP in widgets
    add_filter('widget_text','execute_php',100);
    function execute_php($html){
         if(strpos($html,"<"."?php")!==false){
              ob_start();
              eval("?".">".$html);
              $html=ob_get_contents();
              ob_end_clean();
         }
         return $html;
    }

    Hopefully that helps.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #77844

    hich
    Participant
    Post count: 16

    Hi!

    Many thanks for your fast reply. In fact, I will have to add the code in the template not the widget area. The reason for that is simple; There’s only one checkout page and several products. We can modify the widget area in the sidebar for one product only, but each time a user click on the checkout link he must get the full product description. Just like StudioPress when you checkout to buy a theme, you have in the sidebar right “your order summary” for each of the themes. It’s a different sidebar per product.

    Let me know :) and many thanks!

    • This reply was modified 1 year ago by  hich.
    • This reply was modified 1 year ago by  hich.
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.