badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Reply To: Integrating Woocommerce

#11988
magenta-heaven
Participant

I have a solution. Here are URLs where you need to make changes. And these changes.
1. In file /wp-content/themes/attitude/library/structure/content-extensions.php add this code:

/****************************************************************************************/
add_action( ‘attitude_woo_container’, ‘woo_content’, 10 );
/**
* Function to display the content for the single post, single page, archive page, index page etc.
*/
function woo_content() {

global $post;
global $attitude_theme_options_settings;
$options = $attitude_theme_options_settings;
if( $post ) {
$layout = get_post_meta( $post->ID, ‘attitude_sidebarlayout’, true );
}
if( empty( $layout ) || is_archive() || is_search() || is_home() ) {
$layout = ‘default’;
}

if( ‘default’ == $layout ) {
$themeoption_layout = $options[ ‘default_layout’ ];

get_template_part( ‘content’,’woocommerce’ );
}
}
/****************************************************************************************/

2. Copy and rename file /wp-content/themes/attitude/content-leftsidebar.php -> /wp-content/themes/attitude/content-woocommerce.php

3. In file content-woocommerce.php change this:

<div id=”primary”>
<?php woocommerce_content(); ?>
</div><!– #primary –>

4. In woocommerce.php change this:

<div id=”container”>
<?php
/**
* attitude_woo_container hook
*
* HOOKED_FUNCTION_NAME PRIORITY
*
* attitude_content 10
*/
do_action( ‘attitude_woo_container’ );
?>
</div><!– #container –>

If you can improve this code – I’ll be grateful