Viewing 15 replies - 1 through 15 (of 17 total)
  • Hi,

    I have the same problem on the theme Abundance. There is no problem on the TwentyEleven theme.

    Nicolas.

    Thread Starter darrenhunt

    (@darrenhunt)

    Ok

    So it displays <div class=”upsells products”> twice on the product page, once before and once after related products. I can switch both off by adding the following on the style sheet:

    .upsells.products {
    display: none;
    }

    But obviously don’t want to do that, I would like to display one. Anyone know which page /template I need to edit as I assume there is a wordpress hook and a woocommerce hook so I was hoping I could remove one of them?

    Thanks

    I am having the same problem. This may not be much help but I have a feeling it is something in theme-woocommerce.php

    This is the code starting on line 85

    // Change columns in related products output to 3 and move below the product summary
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
    add_action( 'woocommerce_after_single_product', 'woocommerce_output_related_products', 20);
    
    if (!function_exists('woocommerce_output_related_products')) {
    	function woocommerce_output_related_products() {
    	    woocommerce_related_products(3,3); // 3 products, 3 columns
    	}
    }
    
    // Change columns in upsells output to 3 and move below the product summary
    remove_action( 'woocommerce_after_single_product', 'woocommerce_upsell_display');
    add_action( 'woocommerce_after_single_product', 'woocommerceframework_upsell_display', 20);
    
    if (!function_exists('woocommerceframework_upsell_display')) {
    	function woocommerceframework_upsell_display() {
    	    woocommerce_upsell_display(3,3); // 3 products, 3 columns
    	}
    }

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still – use the pastebin. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]

    I’m not great with code so I don’t want to start changing stuff, but maybe you can see something here?

    Thread Starter darrenhunt

    (@darrenhunt)

    Thanks damien19, I ended up doing just that, found it in the theme-woocommerce.php and commented it out, which worked. So only one version showing, which I assume must have something to do with the theme documents.

    In the same boat with code as you!

    No idea how robust my comment would be when it comes to upgrading woo commerce? Maybe someone with a bit ore knowledge may want to suggest a better way, if one exists?

    Thanks again guys

    Glad you got it figured out, would you mind sharing the exact code you added and exactly where you added it? I tried adding this:

    .upsells.products {
    display: none;
    }

    in theme-woocommerce.php where the other upsell code is and it crashed the site. I had to go in via FTP and remove it. Do you think you could show me the details of how you did it?

    Thanks in advance if you can take the time to help me out, I know time is valuable.

    Thread Starter darrenhunt

    (@darrenhunt)

    All I did was comment out the following upsells code in the Mystile – theme/woocommerce.php file. See my comments in place below. So I guess this is the mystile hook, and I know have one upsell section showing which I assume is the woocommerce hook.

    I wasn’t bothered which one I turned off as I am not showing the rather random related products either so didn’t have to worry whether it was above or below!

    Hope this helps

    /*-----------------------------------------------------------------------------------*/
    /* SINGLE PRODUCTS */
    /*-----------------------------------------------------------------------------------*/
    
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
    add_action( 'woocommerce_after_single_product', 'woocommerce_output_related_products', 20);
    
    if (!function_exists('woocommerce_output_related_products')) {
    	function woocommerce_output_related_products() {
    	    woocommerce_related_products(4,4); // 3 products, 3 columns
    	}
    }
    
    // Upsells
    /*remove_action( 'woocommerce_after_single_product', 'woocommerce_upsell_display');
    add_action( 'woocommerce_after_single_product', 'woocommerce_output_upsells', 20);
    
    if (!function_exists('woocommerce_output_upsells')) {
    	function woocommerce_output_upsells() {
    	    woocommerce_upsell_display(4,4); // Display 3 products in rows of 3
    	}
    }*/

    Wow, that was easy, thanks so much for taking the time to explain it to me, worked like a charm.

    Thanks so much for the information! Since you can’t get help from the creators, this was very, very useful! Anyone know why the sidebar shows up below the products? That’s the next major bug I need to fix ??

    Thank you so much! It worked!

    Hmmm, how odd…I have the exact same problem but no such code snippets exist for me — and I’m using a free WooThemes theme, too! But it’s Wootique….

    Okay, what’s finally worked for me is to remove

    add_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );

    from the woocommerce-hooks.php file…thanks for the “inspiration,” guys!

    Thread Starter darrenhunt

    (@darrenhunt)

    glad we could be of some help ??

    Got another problem, it would appear that the custom.css, and probably the mystile ‘styles’ css isn’t being loaded in ie7 & 8. Anyone else come across this problem?

    Thanks

    Darren

    I had the same issue using the abundance theme but rather then removing it from the woocommerce-theme.php I would recommend putting it in the functions.php within your theme so one can still update the plugin like so;

    remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_upsell_display’, 15 );
    remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 20);
    remove_action( ‘woocommerce_single_product_summary’, ‘avia_woocommerce_output_related_products’, 60);

    I had the same problem (Using Artificer Free Theme From Woo Commerce) I could not find the file that contained all that code so I used wpShoppingCartReviews.com solution I copied the three add_action snippets of code from the woocommerce-hooks.php file and placed them in the Theme Functions in the editor and it worked like so

    add_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_product_data_tabs’, 10 );
    /* add_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_upsell_display’, 15 ); */
    add_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 20 );

    I had the third one commented out too for some reason – and the reason for that was that it displays the related products and automatically changes to three different related products on each refresh of the pages. So on second thoughts I have left it in. Thanks Everyone for this information. Now I can move on.

    Hi, each product on my product page are showing up twice, what could be the reason and how can i fix this…? any help to resolve this issue is much appreciated. thanks… here is the link to the products page on my site…https://miriamsearthencookware.com/store/

    I am using Woocomerce.

    thanks,

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘[Plugin: WooCommerce – excelling eCommerce] Duplicate Up-Sells on product page’ is closed to new replies.