Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1294736

    Hi,

    I’ve been looking around for the solutions but I didn’t found it yet.
    On this page I need the productcategories overview on the left side of the product-details. Currently the overview is positioned below the product.
    I need the overview as it is on this page

    Thx for the help

    • This topic was modified 3 years, 7 months ago by creatorke.
    #1295429

    Hey creatorke,

    Thank you for the inquiry.

    That is the default position of the widgets in the single product page, but we could adjust it using hooks or doing a bit of template modification.

    Please add this code in the functions.php file.

    add_action('init','ava_product_sidebar_init_mod', 50);
    function ava_product_sidebar_init_mod() {
    	remove_action( 'woocommerce_before_single_product_summary',  'avia_close_image_div', 20);
    	add_action( 'woocommerce_before_single_product_summary',  'avia_close_image_div_mod', 20);
    	add_action( 'woocommerce_after_single_product_summary', 'avia_add_sidebar_mod', 19);
    }
    
    function avia_close_image_div_mod() {
    	echo "</div>";
    }
    
    function avia_add_sidebar_mod() {
    	global $product, $avia_config;
    	if( is_product() ) {
    		$avia_config['currently_viewing'] = "shop_single";
    		get_sidebar();
    	}
    }
    

    And insert this css code in the Quick CSS field to move the sidebar to the left.

    .single-product-main-image {
        width: 25%;
    }
    
    .single-product-summary {
        overflow: hidden;
        width: 45%;
        float: right;
        margin-right: 5%;
    }
    
    .single-product .sidebar {
        width: 25%;
    }
    

    Best regards,
    Ismael

    #1295456

    Hi Ismael

    I’ve added the code to functions.php but i’m getting a syntax error.
    See image attached

    • This reply was modified 3 years, 7 months ago by creatorke.
    #1295704

    Hey!

    Thank you for the update.

    For some reason, the forum breaks this code into two different lines, which creates the error.

    echo "</div>
    ";
    

    We corrected it above. Please try the snippet again.

    Best regards,
    Ismael

    #1295743

    Hi Ismael,

    I’ve added the code in functions.php and style.css, but the categories remain below the product. Not at the left of the product. See this page

    Could you check it out?

    #1296022

    Hi,

    Thank you for the info.

    We tried to login using the account above but it seems to be invalid. Please check the info carefully or provide another admin account.

    Best regards,
    Ismael

    #1296023
    This reply has been marked as private.
    #1296033

    Hi,

    Thank you for following up.

    We updated the code in the functions.php file.

    
    /* zijbalk op productpagina */
    function ava534345953_init() {
    	add_action( 'woocommerce_after_single_product_summary', 'avia_add_sidebar', 25);
    	add_action( 'woocommerce_after_single_product_summary', 'avia_close_image_div_mod', 20);
    	add_action( 'woocommerce_before_single_product_summary', 'avia_open_image_div_mod', 1 );
    }
    
    function avia_open_image_div_mod() {
    	echo "<div class='product-main-container'>";
    }
    
    function avia_close_image_div_mod() {
    	echo "</div>";
    }
    
    function avia_add_sidebar() {
    	if(is_product()) {
    		$avia_config['currently_viewing'] = "shop_single";
    		get_sidebar();
    	}
    }
    add_action('init','ava534345953_init', 50);
    

    And use this css code instead.

    .product-main-container {
        width: 63%;
        float: right;
        margin-left: 50px;
    }
    
    .product-main-container::after {
    	content: '';
    	display: table;
    	clear: both;
    }
    
    .product-main-container .single-product-main-image, .product-main-container .single-product-summary  {
    	width: 100%;
    }
    
    #top #main .sidebar {
        border-left: 0;
        border-right-style: solid;
        border-right-width: 1px;
        margin-left: 0;
        margin-right: 50px;
        padding-right: 50px;
    }
    

    The widget area is now located in the sidebar.

    Best regards,
    Ismael

    #1296035

    Hi,
    thx.
    On this category-page I see the categories in the sidebar

    However
    on the productpage, sidebar is empty

    #1296353

    Hi,

    The product category widget is now displaying properly in the single product page. How did you fix it?

    Thank you for your patience.

    Best regards,
    Ismael

    #1296356

    Hi,

    I forgot to mention, after deleting cache, problem was solved.
    Thx for the help!

    #1296431

    Hi,

    Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

    #1296734

    Hi,
    you can close the topic.
    best regards,

    #1296736

    Hi creatorke,

    We’re glad to hear that :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Left sidebar on single shoppage Enfold’ is closed to new replies.