change link of floating cart to an inner page?

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Sat Feb 07, 2015 1:27 am
Reply with quote
Report this post
Hello,

I'm trying to change the floating cart button to go to an inner page, but can't seem to find the place to change this in the code. Don't want the popup cart, as I'm not wanting to use virtuemart for my client, but like the idea of the button that follows a user down the page as they scroll. Will be a schedule button...

site is: 71.19.236.58

Please advise,

Steph H.
User avatar
Fresh Boarder

teitbite
Sun Feb 08, 2015 7:10 pm
Reply with quote
Report this post
Hi

Do You mean to redirect to a different page on cart button click ? Try maybe with a code like this:

Code: Select all
$('#btnCart').click(function() {
    window.location.href = '/some/new/page';
    return false;
});
User avatar
Moderator

GK User
Tue Feb 10, 2015 3:59 pm
Reply with quote
Report this post
I think that would work great. What page would I do this on? Could you provide a path?

Thank you!
User avatar
Fresh Boarder

GK User
Tue Feb 10, 2015 11:15 pm
Reply with quote
Report this post
Got it! Just added this to the bottom of /public_html/templates/gk_storebox/layouts/default.php

Code: Select all
<!--commented out to disable popup box
      <?php $this->layout->loadBlock('tools/cart'); ?>

      <div id="gkPopupOverlay">
      -->
      <?php $this->layout->loadBlock('social'); ?>
         
   <jdoc:include type="modules" name="debug" />
   <script>
   jQuery(document).ready(function(){
         // Target your .container, .wrapper, .post, etc.
         jQuery("body").fitVids();
   });

      //this was given by gavick to help the cart button go to an inner page
      jQuery('#btnCart').click(function() {
          window.location.href = 'contact-us-kalispell';
          return false;
});
   </script>

</body>
</html>
User avatar
Fresh Boarder

GK User
Wed Feb 11, 2015 5:18 pm
Reply with quote
Report this post
Okay, thought this worked, but unfortunately, the relative link is hindering the functionality.

It works fine on the homepage, but when I go to a subpage and click the floating link, it goes to a relative based on that parent menu item.

Is there any way to change the link to be absolute?

Here is the site: 71.19.236.58
User avatar
Fresh Boarder

GK User
Wed Feb 11, 2015 5:23 pm
Reply with quote
Report this post
Nevermind! Tried it again and it works :)
User avatar
Fresh Boarder

teitbite
Thu Feb 12, 2015 9:41 pm
Reply with quote
Report this post
Hi

Have You made any changes to this script so it started to work ?
User avatar
Moderator

GK User
Thu Feb 12, 2015 11:56 pm
Reply with quote
Report this post
only commented out some floating btn cart stuff in the template.css. seems to work great. are you running into issues?
User avatar
Fresh Boarder

teitbite
Sat Feb 14, 2015 9:29 am
Reply with quote
Report this post
Hi

No. I'm just asking so I know the final script that solved the problem. Just in case someone else will be looking for the same answer.
User avatar
Moderator


cron