Static block shortcode in template file - by Roberts

This topic has 9 replies, 2 voices, and was last updated 8 years, 1 months ago ago by Jack Richardson

  • Avatar: Roberts
    Roberts
    Participant
    March 5, 2016 at 14:09

    I am trying to incorporate static block in cart-checkout.php template, but having problems to display it.

    I am using <?php echo do_shortcode(‘[block id=””]’);?> but it brakes template and won’t show anything. Although for other shortcodes it’s working and doing it’s job.

    Any ideas?

    8 Answers
    Avatar: Roberts
    Roberts
    Participant
    March 5, 2016 at 14:18

    Ok, it seems it’s working with simple text blocks. I am trying to use static block which is created using Visual Composer shortcodes. Is there a way do make it work that way?

    Avatar: Roberts
    Roberts
    Participant
    March 5, 2016 at 14:42

    There was something conflicting my custom block data. It works now. I think topic can be deleted as it’s resolved

    Avatar: Roberts
    Roberts
    Participant
    March 5, 2016 at 15:53

    I do have a question if you don’t mind

    I am trying to modify template and split content in form-checkout.php in two columns, but I want to remain “checkout-steps-nav” on top of my columns.

    What are the rules if I want to use certain form-checkout content between shortcodes? For example –
    <?php echo do_shortcode(‘[vc_row][vc_column width=”1/2″] * checkout fields * [/vc_column][vc_column width=”1/2″][block id=””][/vc_column][/vc_row]’);?>

    If I just paste * checkout field * related content between sortcodes it doesn’t work. How would I insert it then?

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    March 7, 2016 at 11:48

    Hello,

    Could you please show a screenshot what you’re trying to achieve?

    Thank you.

    Best regards,
    Jack Richardson.

    Avatar: Roberts
    Roberts
    Participant
    March 7, 2016 at 12:31

    Sure, here are screenshots

    This is what I have currently by using visual composer columns in checkout page
    https://failiem.lv/down.php?i=d9bxx9rr&view

    This is what I want to achieve (I think the only way is to make changes in cart-checkout.php)
    https://failiem.lv/down.php?i=k59wsfgw&view

    I thought I could use <?php echo do_shortcode(‘[vc_row][vc_column width=”1/2″] * checkout fields * [/vc_column][vc_column width=”1/2″][block id=””][/vc_column][/vc_row]‘);?> in cart-checkout.php and leave “checkout-steps-nav” first and put everything else in * checkout fields * in 2nd column.

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    March 9, 2016 at 16:53

    Hello,

    Sorry, but editing woocommerce file won’t resolve the issue as you’ve added Checkout form via Static Block.
    Navigation steps will be centered in full width row, not in the column.

    Best regards,
    Jack Richardson.

    Avatar: Roberts
    Roberts
    Participant
    March 9, 2016 at 18:28

    I know I have added now checkout form via static block. It’s not the case.

    Also no questions how to add static block to form-checkout.php , as <?php echo do_shortcode(‘[block id=””]‘);?> does the job

    What I am asking, is how to ad php content between shortcodes. I could use <?php echo do_shortcode(‘[vc_row][vc_column width=”1/2″] * checkout fields * [/vc_column][vc_column width=”1/2″][block id=””][/vc_column][/vc_row]‘);?> in cart-checkout.php and leave “checkout-steps-nav” first and put everything else in * checkout fields * in 2nd column.

    Then I would just use [woocommerce_checkout] in my checkout page and it will load cart-checkout.php as I want

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    March 9, 2016 at 19:20

    Hello,

    Please take our apologies but this requires additional customization in the files which is beyond our basic support scope. If you wish you can get paid support regarding your query, contact via this form https://www.8theme.com/contact-us/ for further information.

    Best regards,
    Jack Richardson.

  • Viewing 9 results - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.