-
AuthorPosts
-
April 16, 2021 at 9:30 am #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 pageThx for the help
- This topic was modified 3 years, 7 months ago by creatorke.
April 20, 2021 at 6:45 am #1295429Hey 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,
IsmaelApril 20, 2021 at 9:07 am #1295456Hi 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.
April 21, 2021 at 7:34 am #1295704Hey!
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,
IsmaelApril 21, 2021 at 10:17 am #1295743April 22, 2021 at 12:22 pm #1296022Hi,
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,
IsmaelApril 22, 2021 at 12:26 pm #1296023This reply has been marked as private.April 22, 2021 at 12:46 pm #1296033Hi,
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,
IsmaelApril 22, 2021 at 12:49 pm #1296035April 23, 2021 at 2:50 pm #1296353Hi,
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,
IsmaelApril 23, 2021 at 2:56 pm #1296356Hi,
I forgot to mention, after deleting cache, problem was solved.
Thx for the help!April 24, 2021 at 2:05 am #1296431Hi,
Did you need additional help with this topic or shall we close?
Best regards,
Jordan ShannonApril 26, 2021 at 11:48 am #1296734Hi,
you can close the topic.
best regards,April 26, 2021 at 11:49 am #1296736Hi creatorke,
We’re glad to hear that :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Left sidebar on single shoppage Enfold’ is closed to new replies.