Post by k2tec » Thu Jul 27, 2023 5:13 pm

Version 3.0.3.8
I want to move the add to cart button above the the description tab and below the additional images.
with a long description the customers have to scroll down a lot on smaller screens
Thank you

User avatar
Active Member

Posts

Joined
Mon Apr 12, 2010 8:06 pm

Post by SohBH » Thu Jul 27, 2023 5:43 pm

"Add to Cart" button is already located at the specified position in the default theme.

View all extensions | Request custom work | Pricing | Contact Me


User avatar
Active Member

Posts

Joined
Mon Nov 02, 2020 12:01 am
Location - Malaysia

Post by k2tec » Thu Jul 27, 2023 6:04 pm

"Add to Cart" button is already located at the specified position in the default theme.
thanks for you reply, I use always the standard template and make a copy and rename it.
But on mobile phones you have to scroll very long if the description is long.
I found this java script but did not work

Code: Select all

<script>
    $(function(){
        // We create a function
        function moveCart(){
            // If user screen is smaller than 768 pixel
            if($(window).width() < 768 ){
                /*
                    select cart area including cart button, options, product title and ...
                    if you want to only move cart button use '#product' instead of '#content > .row > .col-sm-4'
                */
                $('#content > .row > .col-sm-4').removeClass('col-sm-4').addClass('moved-div');
                // now move it
                $('.moved-div').insertAfter('.thumbnails');
            } else {
                /*
                    if user resized his/her screen width and now screen is wider than 767 pixel and we moved cart area before, move it to its original place.
                */
                if($('.moved-div').length){
                    $('.moved-div').insertAfter('#content > .row > .col-sm-8').addClass('col-sm-4').removeClass('moved-div');
                }
            }
        }

        // run function 
        moveCart();

        $(window).resize(function(){
            // run function again if user resized screen
            moveCart();
        })
    });
</script>

User avatar
Active Member

Posts

Joined
Mon Apr 12, 2010 8:06 pm

Post by SohBH » Thu Jul 27, 2023 6:23 pm

The issue seems to be related to your theme, and unfortunately, it cannot be fixed without reviewing the source code.

View all extensions | Request custom work | Pricing | Contact Me


User avatar
Active Member

Posts

Joined
Mon Nov 02, 2020 12:01 am
Location - Malaysia

Post by straightlight » Thu Jul 27, 2023 6:26 pm

k2tec wrote:
Thu Jul 27, 2023 6:04 pm
"Add to Cart" button is already located at the specified position in the default theme.
thanks for you reply, I use always the standard template and make a copy and rename it.
But on mobile phones you have to scroll very long if the description is long.
I found this java script but did not work

Code: Select all

<script>
    $(function(){
        // We create a function
        function moveCart(){
            // If user screen is smaller than 768 pixel
            if($(window).width() < 768 ){
                /*
                    select cart area including cart button, options, product title and ...
                    if you want to only move cart button use '#product' instead of '#content > .row > .col-sm-4'
                */
                $('#content > .row > .col-sm-4').removeClass('col-sm-4').addClass('moved-div');
                // now move it
                $('.moved-div').insertAfter('.thumbnails');
            } else {
                /*
                    if user resized his/her screen width and now screen is wider than 767 pixel and we moved cart area before, move it to its original place.
                */
                if($('.moved-div').length){
                    $('.moved-div').insertAfter('#content > .row > .col-sm-8').addClass('col-sm-4').removeClass('moved-div');
                }
            }
        }

        // run function 
        moveCart();

        $(window).resize(function(){
            // run function again if user resized screen
            moveCart();
        })
    });
</script>
You can always create a new service request in the Commercial Support section of the forum to have this issue fixed as a custom job.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by k2tec » Thu Jul 27, 2023 6:51 pm

Thanks straightlight for your reply.
If the support forum don't have a answer to this I will. But I hope that some people still share there knowledge on the forum.

SohBH
The issue seems to be related to your theme, and unfortunately, it cannot be fixed without reviewing the source code.
I think you don't read my post. this is a standard theme

User avatar
Active Member

Posts

Joined
Mon Apr 12, 2010 8:06 pm

Post by SohBH » Thu Jul 27, 2023 7:14 pm

You can move the tab content to the bottom
<ul class="nav nav-tabs">
<div class="tab-content">

View all extensions | Request custom work | Pricing | Contact Me


User avatar
Active Member

Posts

Joined
Mon Nov 02, 2020 12:01 am
Location - Malaysia

Post by k2tec » Thu Jul 27, 2023 8:01 pm

Thanks I will test it this evening first I have to setup a test server

User avatar
Active Member

Posts

Joined
Mon Apr 12, 2010 8:06 pm
Who is online

Users browsing this forum: Majestic-12 [Bot] and 56 guests