Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #294499

    sjk005
    Participant

    Hi folks,

    I wanted to use the default WooCommerce template files for my shop and not the ones that were designed by X to match the stack being used.

    I removed the x/woocommerce templates that override the default ones. This would mean that the default plugins/woocommerce templates would be used.

    My shop page messes up and does not look anything like the default woocommerece templates?

    Using X templates, works fine:

    View post on imgur.com

    Using standard templates, all products are huge, css styles are not standard, etc:

    View post on imgur.com

    How can I use standard WooCommerce templates instead of the X ones without messing up my store?

    Regards.

    #294871

    Thai
    Moderator

    Hi There,
    Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    #295148

    sjk005
    Participant
    This reply has been marked as private.
    #295464

    Rad
    Moderator

    Hi there,

    X is integrated to woocommerce by means of custom template and filters. Removing them will of course remove the integration. What you’re experiencing is the result of it. Woocommerce templates are not main templates, they are just sub templates and just wrapped by theme’s major templates. Deleting it, will not remove major templates styling and features.

    Since you removed them, it looks like it needs bug fixing that we can’t provide. As we don’t support removal of X’s features.

    But, you can try this and since you removed your woocommerce templates. Why not remove the codes inside this file too ?

    x ▸ framework ▸ functions ▸ global ▸ plugins ▸ woocommerce.php

    Thanks!

    #295529

    sjk005
    Participant

    Hi,

    Not sure if you actually checked the FTP but I didn’t remove anything yet. I have two copies, one for dev use and the other for live. The login I provided has a standard updated copy of X and works fine.

    The standard X Woocommerce is not allowing a sidebar which was the second question I asked earlier. “2) The side bar is not showing no matter what I do. I’ve followed numerous posts (like this one: https://community.theme.co//forums/topic/remove-sidebar-from-woocommerce-shop-page/ ) but none seem to work.”

    Can you please tell me how to show the sidebar?

    Thank you.

    #295728

    Paul R
    Moderator

    Hi,

    I would like to check but the login your provided is not working

    http://screencast.com/t/o1YNl1iDiU

    To add sidebar to your shop page, you can try adding the code below in your child theme’s functions.php

    
    function x_get_content_layout() {
    
        $content_layout = x_get_option( 'x_layout_content', 'content-sidebar' );
    
        if ( $content_layout != 'full-width' ) {
          if ( is_home() ) {
            $opt    = x_get_option( 'x_blog_layout', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_singular( 'post' ) ) {
            $meta   = get_post_meta( get_the_ID(), '_x_post_layout', true );
            $layout = ( $meta == 'on' ) ? 'full-width' : $content_layout;
          } elseif ( x_is_portfolio_item() ) {
            $layout = 'full-width';
          } elseif ( x_is_portfolio() ) {
            $meta   = get_post_meta( get_the_ID(), '_x_portfolio_layout', true );
            $layout = ( $meta == 'sidebar' ) ? $content_layout : $meta;
          } elseif ( is_page_template( 'template-layout-content-sidebar.php' ) ) {
            $layout = 'content-sidebar';
          } elseif ( is_page_template( 'template-layout-sidebar-content.php' ) ) {
            $layout = 'sidebar-content';
          } elseif ( is_page_template( 'template-layout-full-width.php' ) ) {
            $layout = 'full-width';
          } elseif ( is_archive() ) {
            if ( x_is_shop() || x_is_product_category() || x_is_product_tag() ) {
              $layout = 'content-sidebar';
            } else {
              $opt    = x_get_option( 'x_archive_layout', 'sidebar' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            }
          } elseif ( x_is_product() ) {
            $layout = 'full-width';
          } elseif ( x_is_bbpress() ) {
            $opt    = x_get_option( 'x_bbpress_layout_content', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( x_is_buddypress() ) {
            $opt    = x_get_option( 'x_buddypress_layout_content', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_404() ) {
            $layout = 'full-width';
          } else {
            $layout = $content_layout;
          }
        } else {
          $layout = $content_layout;
        }
    
        return $layout;
    
      }
    

    Hope that helps

    #296072

    sjk005
    Participant

    Hi,

    Sorry, you should be able to login now. Also, I added the above function() to x-child’s functions.php but it did not make a difference. No matter what template I choose, I cannot get the sidebar to show.

    Thank you so much for helping. I am pulling my hair out trying to figure out what is the issue.

    #296595

    Paul R
    Moderator

    Hi,

    I was able to add sidebar to your woocommerce pages by changing the code in your child theme’s functions.php with this.

    
    function x_get_content_layout() {
    
        $content_layout = x_get_option( 'x_layout_content', 'content-sidebar' );
    
        if ( $content_layout != 'full-width' ) {
          if ( is_home() ) {
            $opt    = x_get_option( 'x_blog_layout', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_singular( 'post' ) ) {
            $meta   = get_post_meta( get_the_ID(), '_x_post_layout', true );
            $layout = ( $meta == 'on' ) ? 'full-width' : $content_layout;
          } elseif ( x_is_portfolio_item() ) {
            $layout = 'full-width';
          } elseif ( x_is_portfolio() ) {
            $meta   = get_post_meta( get_the_ID(), '_x_portfolio_layout', true );
            $layout = ( $meta == 'sidebar' ) ? $content_layout : $meta;
          } elseif ( is_page_template( 'template-layout-content-sidebar.php' ) ) {
            $layout = 'content-sidebar';
          } elseif ( is_page_template( 'template-layout-sidebar-content.php' ) ) {
            $layout = 'sidebar-content';
          } elseif ( is_page_template( 'template-layout-full-width.php' ) ) {
            $layout = 'full-width';
          } elseif ( is_archive() ) {
            if ( x_is_shop() || x_is_product_category() || x_is_product_tag() ) {
              $opt    = x_get_option( 'x_woocommerce_shop_layout_content', 'sidebar' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            } else {
              $opt    = x_get_option( 'x_archive_layout', 'sidebar' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            }
          } elseif ( x_is_product() ) {
            $layout = 'full-width';
          } elseif ( x_is_bbpress() ) {
            $opt    = x_get_option( 'x_bbpress_layout_content', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( x_is_buddypress() ) {
            $opt    = x_get_option( 'x_buddypress_layout_content', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_404() ) {
            $layout = 'full-width';
          } else {
            $layout = $content_layout;
          }
        } else {
          $layout = $content_layout;
          if ( is_archive() ) {
            if ( x_is_shop() || x_is_product_category() || x_is_product_tag() ) {         
              $layout = 'content-sidebar';
            }
          }
        }
    
        return $layout;
    
      }
    

    Kindly check on your end.

    http://www.inktv.org/shop/

    Thanks

    #297031

    sjk005
    Participant

    Hi there,

    That’s awesome, it’s working. But few issues with this approach.

    No matter what options I choose in the WooCommerce Customizer and the Page Attribute Templates, no changes occur. For example, choosing Layout – Sidebar Left, Content Right, does nothing. The sidebar remains on the right. Or choosing Full width layout in the Customizer does nothing either.

    http://i.imgur.com/UNtGiG6.png

    Lastly, the following code added to the Customizer does not show the icons next to each widget (as in the demo: http://theme.co/x/demo/shop/icon/ )

    .widget_shopping_cart .h-widget:before {
      content: "\f07a";
      top: -0.05em;
      font-size: 0.945em;
    }
    .widget_product_search .h-widget:before {
    content: "\f0a4";
      top: -0.075em;
      font-size: 0.85em;
    }
    .h-widget:before {
      padding-right: 0.4em;
      font-family: "fontawesome";
    }

    Please let me know why this is the case. You’ve been extremely helpful. Thank you so much.

    #297670

    Christopher
    Moderator

    Hi there,

    #1 Page templates are not working for shop and blog pages. If you wish to remove sidebar for shop page simply remove the code we added in functions.php file.

    #2 Seems like you added the code in customizer, right? if so please update your code to :

    .widget_shopping_cart .h-widget:before {
      content: "\\f07a";
      top: -0.05em;
      font-size: 0.945em;
    }
    .widget_product_search .h-widget:before {
    content: "\\f0a4";
      top: -0.075em;
      font-size: 0.85em;
    }
    .h-widget:before {
      padding-right: 0.4em;
      font-family: "fontawesome";
    }

    Hope it helps.

    #298449

    sjk005
    Participant

    Hi,

    #1 Is this something you can possibly suggest the development team to add in a future release? It would be so helpful. 🙂

    #2 Awesome, I see I was missing the two backslashes (\\).

    Thank you so much! Resolved. 😀

    #299016

    Paul R
    Moderator

    Hi,

    Yes, This is something we can add to our list of feature requests. This way it can be taken into consideration for future development. All of these items are discussed with our team internally and prioritized based on the amount of interest a particular feature might receive. Thanks!