• hi

    i want the cart page to show

    * cross ups/upsells
    * the cart product table
    * cart totals info

    rather than

    * cart product table
    * cross sells
    * cart total info

    any idea how to do this?

    i edited the template file to move the “<div class=”cart-collaterals”>” above the cart table, however it also moved the cart totals area..

    be better to have the cross sells above the cart table as then the proceed to checkout area is not hidden, as i want 4 cross sells at the cart page in a row..

    thanks

    https://www.ads-software.com/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Suggest leaving the template file alone so it can be updated by WooCommerce later if necessary, and try something like this in functions.php for your child theme:

    // remove cross-sells from their normal place
    remove_action( 'woocommerce_cart_collaterals',
    'woocommerce_cross_sell_display' );
    // add them back in further up the page
    add_action ('woocommerce_before_cart', 'woocommerce_cross_sell_display' );

    Some custom css may be needed to tidy up the page appearance.

    More about hooks:
    https://docs.woothemes.com/wc-apidocs/hook-docs.html

    I’m also trying to adjust the layout of cross sells relative to the cart totals. Right now, the totals are on the left and the cross sells are directly below the totals.

    I want to display the cross sells next to the totals box. Totals on the left and cross sells on the right.

    I added:

    // remove cross-sells from their normal place
    remove_action( 'woocommerce_cart_collaterals',
    'woocommerce_cross_sell_display' );
    // add them back in further up the page
    add_action ('woocommerce_after_cart_totals', 'woocommerce_cross_sell_display' );

    To the functions but it’s only adding the cross sells to the same spot as where they were previously.

    How can I get the cross sells to show up next to the totals?

    Hooks are listed here:
    https://docs.woothemes.com/wc-apidocs/hook-docs.html

    The other hook that’s nearby is ‘woocommerce_after_cart_table’. Not tried it but suspect it will put the cross sells between the table and the totals, not at the side of the totals.

    You’ll probably need to copy:
    wp-content/plugins/woocommerce/templates/cart/cart.php
    to
    wp-content/themes/your-theme-name/woocommerce/cart/cart.php
    and edit the copy to suit. PHP skills and some time will be needed.

    If you already have a theme cart.php you will need to make a child theme and copy it there.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change Cart Layout With Cross Sells’ is closed to new replies.