Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1308787

    Hi!
    Below my products I have chosen “Upsell products”. How do I center this column? It’s now placed to the left.

    BR

    #1308791

    Hi,

    Thanks for contacting us!

    Could you please post a link to your page? I could not reproduce it on my local installation. Attached a screenshot in private content field below :)

    Regards,
    Yigit

    #1308795

    Hi!
    Thanks for your fast respond :) Unfortunately it’s in maintaince mode. Just how the pictures are centered is how I wan’t them to be :) And the text “You may also like” centered too.. My page is set to stretched layout.

    Is there any code I can try to center the Upsell product column on evey single product page?

    Thanks again Yigit!
    Br!

    #1308867

    Hi,

    Thanks for the update. If your site is in maintenance mode, then please provide us with login details in private. It’s much easier for us to help you out, if we can see the elements on your actual site.

    Best regards,
    Rikard

    #1309052

    Hi!
    Posted a link in private content.
    It’s the “Matcha med…” under the product gallery I want to be centered…

    Br

    #1309056

    Sorry, I mean it’s the “Du gillar kanske också…” column.

    #1309099

    Hi,

    Do you always add 2 products to upsells? If so, please add following code to bottom of Functions.php file of your child theme

    /**
     * Change number of upsells output
     */
    add_filter( 'woocommerce_upsell_display_args', 'wc_change_number_related_products', 20 );
    
    function wc_change_number_related_products( $args ) {
     
     $args['posts_per_page'] = 2;
     $args['columns'] = 2; //change number of upsells here
     return $args;
    }

    Then add following code to Quick CSS field in Enfold theme options > General Styling

    #top.single-product .up-sells .products.columns-2 { width: 50%; margin: auto; }
    #top.single-product .up-sells .products.columns-2 .product { width: 49%; }
    #top .upsells.products h2 { text-align: center; } 

    Best regards,
    Yigit

    #1316274

    Hi!
    Thank you, I want to add more than two products to upsell. Probably 7 as maximum.
    I added the code below which did center the heading “You may also like”:
    #top .upsells.products h2 { text-align: center; }

    But now I also wan’t to center the pictures, how do I do this?
    And is there anyway I can make the pictures a little bit smaller?

    Br

    #1316296

    Hi,

    You would need to change the code to following one to display 7 columns

    /**
     * Change number of upsells output
     */
    add_filter( 'woocommerce_upsell_display_args', 'wc_change_number_related_products', 20 );
    
    function wc_change_number_related_products( $args ) {
     
     $args['posts_per_page'] = 7;
     $args['columns'] = 7; //change number of upsells here
     return $args;
    }

    and use following CSS code instead

    #top .product_column_4 .upsells .products .product {
        width: 13.4%;
    }
    #top .upsells.products h2 { text-align: center; } 

    Result should be as following – https://imgur.com/a/TRDKsrV

    Best regards,
    Yigit

    #1316299

    Hi!
    Thank you for your fast respond :)
    So there isn’t a way to just center the picture column without changing the amount of products to display?

    Br

    #1316302

    Hi,

    Would you like to display 7 products in 2 column layout? If so, you would need to change the code in functions.php file to following one

    /**
     * Change number of upsells output
     */
    add_filter( 'woocommerce_upsell_display_args', 'wc_change_number_related_products', 20 );
    
    function wc_change_number_related_products( $args ) {
     
     $args['posts_per_page'] = 7;
     $args['columns'] = 2; //change number of upsells here
     return $args;
    }

    If that too does not help, can you post a screenshot and show the changes you would like to make so we can make sure that we are on the same page? :)

    Best regards,
    Yigit

    #1316309

    Hi!
    Thanks again for your fast respond :)
    I will have different amount of Upsell products depending on which product page it is.
    All I want to do is center the column so the Upsell products aren’t placed to the left.
    Right now the title “You may also like..” is centered, but the products underneath the title are aligning to the left.
    This is how the upsell products are placed right now (but the title “you might also like..” centered):

    Set up Related Products, Up-Sells and Cross-Sells

    Br

    #1316633

    Hi,

    I now understand the changes you would like to make however unfortunately such customization would be out of the scope of our support I am afraid. If that is really important for you, please consider to hire a freelance developer for the task :)

    Best regards,
    Yigit

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.