Post by Bobbio999 » Wed Mar 13, 2019 8:33 pm

Hi,

Does anybody know how to make the PRICE float on screen at all times.

I have a huge amount of options, all with different prices, that continually update the price on the product screen. (using Live Price Update module).
The problem is the user has to keep scrolling up and down the page to check how each option choice changes the price. For this reason it would be really helpful if the price would always remain in view on screen on the product page.

As an example:
https://envelopesprinted.com/Standard-E ... front-back

Open Cart Version 2.0.3.1

New member

Posts

Joined
Thu Apr 16, 2015 11:19 pm

Post by cyclops12 » Sun Mar 17, 2019 10:04 pm

You could use something like This and just wrap the described div around the price

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by Bobbio999 » Wed Apr 10, 2019 9:20 pm

I fixed it myself using sticky (doesn't work on IE). If anyone else is interested in this feel free to ask, also i've summised it below:

../product.tmpl

Code: Select all

<style>
div.sticky {
  position: -webkit-sticky;
  position: sticky;
  background-color: white;
 top: 0;
}
</style>
<div class="sticky">
<?php if ($price) { ?>
          <ul class="list-unstyled">
            <?php if (!$special) { ?>
YOU PAY: <?php echo $price; ?>
            </li>
            <?php } else { ?>
            <li><?php echo $price; ?></li>
            <li>
              <h2><?php echo $special; ?></h2>
            </li>
            <?php } ?>
            <?php if ($tax) { ?>
            <li><?php echo $text_tax; ?> <?php echo $tax; ?></li>
            <?php } ?>
 <?php if ($discounts) { ?>
            <li>
              <hr>
 <?php } ?>
          </ul>
          <?php } ?>   </li>
</div>

New member

Posts

Joined
Thu Apr 16, 2015 11:19 pm
Who is online

Users browsing this forum: No registered users and 14 guests