organicinternet / magento-configurable-simple

Enhancement to Magento to allow simple product prices to be used instead of the default special-case configurable product prices
http://organicinternet.co.uk/
283 stars 266 forks source link

Issues with SCP on 1.7.0.1 and price reverts to £0.00 #97

Open fRAiLtY- opened 12 years ago

fRAiLtY- commented 12 years ago

Hi,

I've checked the previous issues relating to this and cannot seem to solve my issue with the solutions mentioned there. On this page:

http://dev4.printpartnerships.com/flyer-printing you'll see I have SCP running.

Basically do the following combination:

1) A6 2) 5000 3) 300gsm Gloss 4) 24hrs

You'll see a multi-select custom options appear, however once this multi-select appears the price reverts to £0.00. For a split second before the multi-select appears the price is correct, so it's the on load of these custom options that's causing it?

Can anyone assist?

Cheers.

surflibre commented 12 years ago

I don't see your pb,

For me it's different, when the custom option appear and after choosing the option, the price display 0,00 and nothing else.

The cart is well,

any idea?

Thanks.

fRAiLtY- commented 12 years ago

I've managed to make some progress here, I can get the price to stay correct now, however when I select custom options it doesn't update the price?

Cheers.

z2x2 commented 12 years ago

What did you do to get the price to stay? That may be preventing it from updating the price when selecting the custom options.

surflibre commented 12 years ago

I'm looking for a better solution, but for now I've just make a copy of options.phtml in the file scpajaxoptions.phtml (app/design/frontend/base/default/template/catalog/product/view), and it works.

The price doesn't move when I select my custom options (which price is set to 0.00) and that's what I need.

After I tried with a value on my custom option (4$), and the price doesn't change (ajax).

I think it's a trick between those 2 files, they have to be compare...

Try it and let me know if it you find an issue.

Regards,

fRAiLtY- commented 12 years ago

Try swapping your reloadPrice function in app/design/frontend/default/YOUR_THEME/catalog/product/view/scpoptions.phtml to this:


Product.Options.prototype = {
        initialize : function(config){
            this.config = config;
            this.reloadPrice();
        },
        reloadPrice : function(){
            price = new Number();
            config = this.config;
            skipIds = [];
            $$('.product-custom-option').each(function(element){
                var optionId = 0;
                element.name.sub(/[0-9]+/, function(match){
                    optionId = match[0];
                });
                if (this.config[optionId]) {
                    if (element.type == 'checkbox' || element.type == 'radio') {
                        if (element.checked) {
                            if (config[optionId][element.getValue()]) {
                                price += parseFloat(config[optionId][element.getValue()]);
                            }
                        }
                    } else if(element.hasClassName('datetime-picker') && !skipIds.include(optionId)) {
                        dateSelected = true;
                        $$('.product-custom-option[id^="options_' + optionId + '"]').each(function(dt){
                            if (dt.getValue() == '') {
                                dateSelected = false;
                            }
                        });
                        if (dateSelected) {
                            price += parseFloat(this.config[optionId]);
                            skipIds[optionId] = optionId;
                        }
                    } else if(element.type == 'select-one' || element.type == 'select-multiple') {
                        if (element.options) {
                            $A(element.options).each(function(selectOption){
                                if (selectOption.selected) {
                                    if (this.config[optionId][selectOption.value].price) {
                                        price += parseFloat(this.config[optionId][selectOption.value].price);
                                    }
                                }
                            });
                        }
                    } else {
                        if (element.getValue().strip() != '') {
                            price += parseFloat(this.config[optionId].price);
                        }
                    }
                }
            });
            try {
                optionsPrice.changePrice('options', price);
                optionsPrice.reload();
            } catch (e) {

            }
        }
    }

I found this works and reloads the price with custom options. I've also since upgraded to Mage 1.7.0.2 and it works there also. Any problems let me know.

Try and chuck a couple of console.log() or break points in around the price += parseFloat area to see what it does and when, makes life a bit easier. I found the initial values held "0" hence why it was updating to that.

pandeo commented 11 years ago

It fixed main issue, but when you have option with different prices, the price isnt updating :(

pandeo commented 11 years ago

It fixed main isue, but when you changing associated products, with price updating, then price doesnt changing and staying as main. Like item costing 200 euro, but with option it should cost 220, but when you choosing option for +20, price staying 200 anyway. But when adding in cart, there showing correct price.

jhquiroga commented 11 years ago

Did you take a look to what I posted?? it's a little bit different from #97 I have CE 1.7.0.2 and everything works fine so far (dropdowns, radios, now text fields). I've done the updates til this version from other posts, mainly from: https://github.com/organicinternet/magento-configurable-simple

pandeo commented 11 years ago

Aha! I tested a bit other way, sience nothing working on those posts. I just copied options to scpoption and everything started work like a charm :) Thank you for your support

thebeanieman commented 11 years ago

This works fine for me as well :)

xinxeta commented 11 years ago

I´ve apply the fix. works fine when i have only 1 custom option. but when i have 2 o more options with different prices, the price isnt updating correcttly... http://www.martinmena.es/tienda2012/es/papelera-orbis-110-litros.html

I ned help please!