Hi all
Given an example:
http://www.techarmory.my/index.php?rout ... uct_id=184
I have alot of options for our customer to select the product that they want, but it's very inconvenient that the sub total is always on the top so each time customer pick some selection he/she has to go all the way top of the page to check the total price.
So wondering if there is any modules that can allow me to set a floating subtotal on center right of the screen, as the user scroll, the price floats accordingly.
please advise. thanks
Given an example:
http://www.techarmory.my/index.php?rout ... uct_id=184
I have alot of options for our customer to select the product that they want, but it's very inconvenient that the sub total is always on the top so each time customer pick some selection he/she has to go all the way top of the page to check the total price.
So wondering if there is any modules that can allow me to set a floating subtotal on center right of the screen, as the user scroll, the price floats accordingly.
please advise. thanks
Welcome to the Opencart forum. Interesting request ...
followed is an attached VQMod file and an example on this post for the default theme for Opencart v2.2.0.0 release. If you are using a custom theme, you'd find to find a way to fit it in.
In your catalog/view/theme/default/template/checkout/cart.tpl file,
find:
add right above:
Then, find the second instance of:
add above:
Then, find:
add right below:
Then, find the second instance of:
add below:
This should resolved the problem. Feel free to adjust the looks and feels from the CSS in the jQuery codes. 
Note: If you are not familiar with either OCMod / VQMod extensions, I would suggest to read: http://docs.opencart.com for more information. Also, you can visit: http://www.vqmod.com to use XML files and also OCMod extensions usable from the admin - > extensions - > installer and extensions page.
followed is an attached VQMod file and an example on this post for the default theme for Opencart v2.2.0.0 release. If you are using a custom theme, you'd find to find a way to fit it in.
In your catalog/view/theme/default/template/checkout/cart.tpl file,
find:
Code: Select all
<?php echo $footer; ?>
Code: Select all
<script type="text/javascript"><!--
$(document).ready(function() {
// set the offset pixels automatically on how much the sidebar height is.
// plus the top margin or header height
var offsetPixels = $('.sidebarBox').outerHeight() + 30;
$(window).scroll(function() {
if ( $(window).scrollTop() > offsetPixels ) {
$('.scrollingBox').css({
'position': 'fixed',
'bottom': '300px',
'right': '40px',
'background': '#ff9900',
'font-weight': 'bold',
'color': '#ffffff',
'border': '1px solid #ccc',
'padding': '10px',
'margin-bottom': '20px'
});
} else {
$('.scrollingBox').css({
'position': 'static'
});
}
});
});
//--></script>
Code: Select all
<div class="row">
Code: Select all
<?php $sub_totals = 0.0; ?>
Code: Select all
<?php foreach ($totals as $total) { ?>
Code: Select all
<?php if (trim(strtolower($total['code'])) == 'sub_total') { ?>
<?php $sub_totals = $total['title'] . ': ' . $total['text']; ?>
<?php } ?>
Code: Select all
</table>
Code: Select all
<div class="sidebarBox">
<div class="scrollingBox">
<?php echo $sub_totals; ?>
</div>
</div>

Note: If you are not familiar with either OCMod / VQMod extensions, I would suggest to read: http://docs.opencart.com for more information. Also, you can visit: http://www.vqmod.com to use XML files and also OCMod extensions usable from the admin - > extensions - > installer and extensions page.
Attachments
Sub-Total Floating
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
hi
What if i need the float to be view before a customer confirm an order into the cart?
Given an example as the link below:
https://www.aftershockpc.com/welcome/Pr ... ner/m15-v2
when ever a user change the option, the reflected price shown will be always float and align center of the screen
Thanks
What if i need the float to be view before a customer confirm an order into the cart?
Given an example as the link below:
https://www.aftershockpc.com/welcome/Pr ... ner/m15-v2
when ever a user change the option, the reflected price shown will be always float and align center of the screen
Thanks
The subtotal is only calculated based on the total of all added prices to the cart. Based on your first post and subject, you wish to have a module for floating based on the sub-total price. Not on each product price before they add a product to the cart.stepsecr wrote:hi
What if i need the float to be view before a customer confirm an order into the cart?
Given an example as the link below:
https://www.aftershockpc.com/welcome/Pr ... ner/m15-v2
when ever a user change the option, the reflected price shown will be always float and align center of the screen
Thanks
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Hi.
sorry for confusion earlier. My expression is not very good.
My goal and aim is to add a floating TOTAL PRICE on the product page, but not on the checkout
could you guide me? i am a self learner and i not very good in coding yet
thanks
sorry for confusion earlier. My expression is not very good.
My goal and aim is to add a floating TOTAL PRICE on the product page, but not on the checkout
could you guide me? i am a self learner and i not very good in coding yet
thanks
The order totals are specifically loaded from the cart page and on the checkout page, by default - which both includes the sub-total. Could you elaborate on how exactly do you intend to calculate the sub-total with a simple sales price from the product page?stepsecr wrote:Hi.
sorry for confusion earlier. My expression is not very good.
My goal and aim is to add a floating TOTAL PRICE on the product page, but not on the checkout
could you guide me? i am a self learner and i not very good in coding yet
thanks
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Hi
thanks for the quick feedback.
Okay, like this, under the URL :
http://www.techarmory.my/index.php?rout ... uct_id=182
i need these

info to be float on the product page when customer scroll further down to change some option
And yes i think i am using custom theme with auto price adder.
i think i amended the code by follow the suggestion you gave but i not manage to make it work on product page. Which i guess i don't understand how to amend the below option price changer, and it's code as below:
thanks
thanks for the quick feedback.
Okay, like this, under the URL :
http://www.techarmory.my/index.php?rout ... uct_id=182
i need these

info to be float on the product page when customer scroll further down to change some option
And yes i think i am using custom theme with auto price adder.
i think i amended the code by follow the suggestion you gave but i not manage to make it work on product page. Which i guess i don't understand how to amend the below option price changer, and it's code as below:
Code: Select all
<?php foreach ($option['product_option_value'] as $option_value) { ?>
<option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
Who is online
Users browsing this forum: No registered users and 11 guests