Hello,
I found a problem with this.
I have a product that has a required option called Amount: with other prices listed.
its regular cost is $39.95.
The first option is the regular price with a option price of +0.00 When this option is chosen the price displayed is double.
Second option might be 69.95 with a option price of +30.00 this works correctly by adding the regular price to the $30.00.
It only does this on products with prices that don't end in .00
I am about to start learning javascript and don't know how it works quite yet. Any Idea's would be greatly appreciated.
I can send a link where you can demo what is happening if needed.
This problem can be avoided by making the option not required but I would like people to know there are different price they can purchase before just adding it to the cart.
I found a problem with this.
I have a product that has a required option called Amount: with other prices listed.
its regular cost is $39.95.
The first option is the regular price with a option price of +0.00 When this option is chosen the price displayed is double.
Second option might be 69.95 with a option price of +30.00 this works correctly by adding the regular price to the $30.00.
It only does this on products with prices that don't end in .00
I am about to start learning javascript and don't know how it works quite yet. Any Idea's would be greatly appreciated.
I can send a link where you can demo what is happening if needed.
This problem can be avoided by making the option not required but I would like people to know there are different price they can purchase before just adding it to the cart.
Ok I found a fix for this issue.
catalog\controller\product\product.php around line 255 I changed this
To this
catalog\controller\product\product.php around line 255 I changed this
Code: Select all
} else {
$price = false;
}
Code: Select all
} else {
$price = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
}
Ok just found, if you want radio selection instead of dropdown style,
First in product.tpl find the section
replace this with
Then make these changes in Javascript code (header.tpl):
with this
Works for me, I'm using OC v1.5.4
Glad if I could be help...
First in product.tpl find the section
Code: Select all
<?php if ($option['type'] == 'radio') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<?php foreach ($option['option_value'] as $option_value) { ?>
<input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
<label for="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']; ?>)
<?php } ?>
</label>
<br />
<?php } ?>
Code: Select all
<?php if ($option['type'] == 'radio') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<?php foreach ($option['option_value'] as $option_value) { ?>
<input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>"/>
<label for="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']; ?><span id="newPrice"><?php echo $option_value['price']; ?></span>)
<?php } ?>
</label>
<br />
<?php } ?>
</div>
<br />
<?php } ?>
Code: Select all
$('.option').change(function() {
var OriginalPrice = $('#thisIsOriginal').text();
var OriginalCurrency = OriginalPrice.substring(0, 1);
OriginalPrice = OriginalPrice.substring(1);
OriginalPrice = OriginalPrice.replace(",","");
var newPriceValue = $('.option :selected').text();
Code: Select all
$('input:radio').change(function() {
var OriginalPrice = $('#thisIsOriginal').text();
var OriginalCurrency = OriginalPrice.substring(0, 1);
OriginalPrice = OriginalPrice.substring(1);
OriginalPrice = OriginalPrice.replace(",","");
var newPriceValue = $('input:radio:checked').next().text();
Glad if I could be help...
Hi guys, I have tried to add this to a site I am working on at the moment and would appreciate someone taking a look at it as I can't work out what I have done wrong.
http://www.thequircus.com/store/lemasqueradeprint
http://www.thequircus.com/store/lemasqueradeprint
http://www.opencart.com/index.php?route ... n_id=11730
1 - Live Update Product Price,
2 - Option = * / +% -% + - Price Module,
3 - Enter percents for discounts and specials.
1 - Live Update Product Price,
2 - Option = * / +% -% + - Price Module,
3 - Enter percents for discounts and specials.
Hi,
I found nice and working vqmod extension for price update on option or quantity change. It's from russian opencart forum and some comments in code are in russian - http://opencartforum.ru/files/getdownlo ... jax-vqmod/
I found nice and working vqmod extension for price update on option or quantity change. It's from russian opencart forum and some comments in code are in russian - http://opencartforum.ru/files/getdownlo ... jax-vqmod/
Attachments
Autocalc_price_option
This mod does work but not in conjuction with a conflicting mod I am running.
We are running Options Boost - http://www.opencart.com/index.php?route ... on%20boost
Option Boost lets us set the options as "This Option = $This Price" instead of having to do math and figure out the +$markup for each product. Saves us tons of time with setup and updating pricing.
The mod was changing the displayed price but it was breaking. It was going back to $0.00 for options that didn't give a price increase, and options that did give an increase it would only go back up to the original base price.
Any thoughts?
We are running Options Boost - http://www.opencart.com/index.php?route ... on%20boost
Option Boost lets us set the options as "This Option = $This Price" instead of having to do math and figure out the +$markup for each product. Saves us tons of time with setup and updating pricing.
The mod was changing the displayed price but it was breaking. It was going back to $0.00 for options that didn't give a price increase, and options that did give an increase it would only go back up to the original base price.
Any thoughts?
Hey guys
here is what i have implemented. Please have a look at let me know if any one require assistance with the code.
http://demo1.tecz.com/opencart/index.ph ... duct_id=42
here is what i have implemented. Please have a look at let me know if any one require assistance with the code.
http://demo1.tecz.com/opencart/index.ph ... duct_id=42
Hey php_dipak. I love what you've done and am trying to do something very similar. Would love to know how you did it.php_dipak wrote:Hey guys
here is what i have implemented. Please have a look at let me know if any one require assistance with the code.
http://demo1.tecz.com/opencart/index.ph ... duct_id=42
i am using opencart 2.0.3.1 and after the product.tpl changes i have just come up with the following code to make it work with check boxes and radio buttons as wellfokz8 wrote:can any1 help with this on opencart 2.0.2.0 ?
in their code:
Code: Select all
$('.option').change(function() {
replace this with:
Code: Select all
$('#product input,#product select').change(function() {
in their code where
Code: Select all
var newPriceValue = $('.option :selected').text();
Code: Select all
if($('input.radiooption:checked').closest("label").text()!=''){
var radioPrice=$('input.radiooption:checked').closest("label").text();
}
if($('.option :selected').text()!=''){
var selectPrice=$('.option :selected').text();
}
if($('input.checkboxoption:checked').closest("label").text()!=''){
var checkboxPrice=$('input.checkboxoption:checked').closest("label").text();
}
var newPriceValue = selectPrice+radioPrice+checkboxPrice;
Who is online
Users browsing this forum: No registered users and 29 guests