Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Price isn’t changing, and the configurable product is being added to cart
 
SmallFuel
Jr. Member
 
Total Posts:  3
Joined:  2008-12-02
 

Hi Matt.

First, thanks for this extension. Why Magento wasn’t built this way in the first place I’ll never know, and the fact that they force you to associate a simple product and then specify new pricing anyway is just silly.

Anyhow—I’m trying to install your extension into a custom theme, and it isn’t working correctly. I’m not sure why.

I’ve placed the js and xml files in their respective folders, and have verified that the js is being called (in the right place, too). I’ve also edited price.phtml to include the simple configurable products code.

Every time I try to change the price, though, I get an error “optionsPrice is not defined” and the price listed is the lowest price (it does say “Price From:"). Then when the product is added to the cart the actual configurable product is added and not the simple product.

I’m at a loss as to what is happening. Any ideas?

Thanks,

- Mason

 
Magento Community Magento Community
Magento Community
Magento Community
 
Matt Dean
Guru
 
Avatar
Total Posts:  549
Joined:  2008-05-27
 

Every time I try to change the price, though, I get an error “optionsPrice is not defined” and the price listed is the lowest price (it does say “Price From:"). Then when the product is added to the cart the actual configurable product is added and not the simple product.

I’m at a loss as to what is happening. Any ideas?

Hi SmallFuel,

I’m not sure specifically but here are some things to check:

By default the JavaScript optionsPrice variable is defined in app/design/frontend/default/default/template/catalog/product/view.phtml
Can you check that your theme isn’t overriding this file in such a way that optionsPrice doesn’t get defined?

When I view the source of a conf product page I see some inline js saying something like:

var optionsPrice = new Product.OptionsPrice({"productId":"108","priceFormat":{"pattern":"\u00a3 %s","precision":2,"requiredPrecision":2,"decimalSymbol":".","groupSymbol":",","groupLength":3,"integerRequired":1},"includeTax":"false","showIncludeTax":false,"showBothPrices":false,"productPrice":89.99,"productOldPrice":89.99,"skipCalculate":1,"defaultTax":0,"currentTax":0,"idSuffix":"_clone"});

If that’s there, then make sure that varien/product.js is being loaded in your page too, as that defines the Product.OptionsPrice class.
(though presumably you’d be seeing a different error if that was missing...)

Matt

PS Even with the extension installed, optionsPrice is declared and defined in the core code not the extension code. The extension does assume that it’s been defined, but then the default behaviour of the js used on conf product pages does too.  ...so as far as I can tell you’d be seeing that error even if you uninstalled the extension. I could be wrong though smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
SmallFuel
Jr. Member
 
Total Posts:  3
Joined:  2008-12-02
 

Hey Matt,

You found it—Awesome grin

My original theme files were created for the 1.0 version of Magento and the optionsPrice wasn’t correctly being defined (even though the theme was supposedly upgraded for the newer version of Magento).

Anyhow, I’ve gone in and fixed that and now your extension seems to be working properly (at least in this regard). Now I’m running into a problem where the “price from” number isn’t correct after one selection has been made, but I seem to remember seeing another thread about that so I’ll see if I can fix it myself.

Thanks for your help,

- Mason

 
Magento Community Magento Community
Magento Community
Magento Community
 
Matt Dean
Guru
 
Avatar
Total Posts:  549
Joined:  2008-05-27
 

Glad that pointed you in the right direction.

Regarding the ‘price from’ not being correct… The extension doesn’t change the ‘price from’ value as a user selects options (though it might be nice if it did).  The ‘price from’ stays the same (the lowest possible price) until all options are selected at which point the correct price (from the underlying simple product) is used. 

If that’s the behaviour you’re seeing then that’s the ‘correct’ behaviour for the extension, even if it might not quite be the right thing for your site.

Matt

 
Magento Community Magento Community
Magento Community
Magento Community
 
SmallFuel
Jr. Member
 
Total Posts:  3
Joined:  2008-12-02
 

Hey Matt,

Interesting—the “Price From” number IS actually changing on my site, though not correctly. It appears that once the first option is selected the “price from” changes to a price in the middle of the possibilities somewhere. I haven’t found any logical scheme to the change, so I’m assuming it’s a bug somewhere or an error on my part.

I’ll PM you a link to the site and you can see an example.

- Mason

 
Magento Community Magento Community
Magento Community
Magento Community
 
Matt Dean
Guru
 
Avatar
Total Posts:  549
Joined:  2008-05-27
 
SmallFuel - 07 December 2008 09:43 AM

Hey Matt,

Interesting—the “Price From” number IS actually changing on my site, though not correctly. It appears that once the first option is selected the “price from” changes to a price in the middle of the possibilities somewhere. I haven’t found any logical scheme to the change, so I’m assuming it’s a bug somewhere or an error on my part.

I’ll PM you a link to the site and you can see an example.

- Mason

Yeah it’s a bug, and quite a big one actually. Well spotted. I’ve released v0.3 which fixes it.

Mason I’ve PM’d you about this already, but for everyone else’s benefit:

This bug sometimes causes the wrong ‘Price From:’ value to appear on product pages when some but not all options are selected.

This bug occurs only with products that have more than one configurable option, and only in cases where the possible prices for the product cross a unit boundary (ie. £1 -> £10 or £100 -> £1000 or £0.1 -> £10000 etc)

The problem was a basic programming error on my part. I’ve been doing too much PHP recently and not enough JavaScript!

Specifically the problem was in the JS logic that calculates the min price for the configurable product. This code was being handed the prices as Strings instead of Numbers. This meant that for example it thought that 1999.00 was less than 999.00 (because alphabetically it is) so gave the wrong minimum price.
(The displayed ‘Price From’ value uses this JS-calculated min price only when some but not all of the product options are selected, so that’s why you don’t see it straight away)

Anyway, if you’re using this extension you should probably upgrade as it’s quite confusing for users when it goes wrong.

Cheers,
Matt

 
Magento Community Magento Community
Magento Community
Magento Community
 
beebware
Jr. Member
 
Total Posts:  9
Joined:  2008-12-30
Harrow, UK
 

Hello Matt,

First of all - brilliant extension: just what we needed to help move away from ClickCartPro. However..

Problem 1: 1.2.1 (and 1.2.0) compatibility issues
======================================
It doesn’t quite work in Magento 1.2.1: there are Javascript errors generated (when the default/simpleconfigurableproducts theme is selected) which prevents the image-mover thingy and the price changing from working.

Basically the errors:
----------------
<br />
<b>Warning</b>: file_get_contents(/var/www/js/calendar/lang/calendar-en.js) [<a href=’function.file-get-contents’>function.file-get-contents</a>]: failed to open stream: No such file or directory in <b>/var/www/js/index.php</b> on line <b>106</b><br />
<br />
<b>Warning</b>: filemtime() [<a href=’function.filemtime’>function.filemtime</a>]: stat failed for /var/www/js/calendar/lang/calendar-en.js in <b>/var/www/js/index.php</b> on line <b>107</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/js/index.php:106) in <b>/var/www/js/index.php</b> on line <b>120</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/js/index.php:106) in <b>/var/www/js/index.php</b> on line <b>121</b><br />
<br />
...
-
are caused when http://www.site.local/js/index.php?c=auto&f;=,prototype/prototype.js,prototype/validation.js,scriptaculous/builder.js,scriptaculous/effects.js,scriptaculous/dragdrop.js,scriptaculous/controls.js,scriptaculous/slider.js,varien/js.js,varien/form.js,varien/menu.js,mage/translate.js,mage/cookies.js,varien/product.js,calendar/calendar.js,calendar/lang/calendar-en.js,calendar/calendar-setup.js is called due to the face /var/www/js/calendar/lang doesn’t exist… Copying the files from an old (1.8 IIRC) version allows it to work correctly.

I’m not sure if this bug is in your code or in the latest version of Magento (I suspect the latter), but it only occurs with the “default/simpleconfigurableproducts” theme and not “default/default” or “default/modern”. This has been tested from a “fresh install” and an upgraded install.

Problem 2: Taxation
================
I have a configurable product which consists of 2 “No tax” items (childrens clothing - which in the UK is 0% VAT) and 6 Tax items (adult clothing which is currently taxed at 15%).

All the Simple Products are identical apart from the price, tax status["tax_class_id"] and size setting (ok, there are also a few minor other differences such as “Cost price”, “Supplier code”, “SKU” - but these shouldn’t matter).

However, if the configurable item has a “Taxable” tax_class_id, then ALL products have tax applied to them. If it has a “No tax” tax_class_id, then NONE of the products have tax applied to them (i.e. it doesn’t respect the simple products class status).

 
Magento Community Magento Community
Magento Community
Magento Community
 
Matt Dean
Guru
 
Avatar
Total Posts:  549
Joined:  2008-05-27
 

Hi beebware,

Thanks for letting me know that it doesn’t work with Magento 1.2.  I can’t say I’m surprised as it relies on some core Magento code that Varien seem to like to change with every release.  (I do try to make the extension as upgrade-resilient as possible but I can’t anticipate every move Varien might make)

And as for the taxation thing I’ll take a look too - I thought I’d got it right but apparently not!
(Actually, can you confirm that it’s the case that the tax is only incorrect on the product page and that it’s calculated fine once you add it to your basket?)

I’m afraid I’m not going to get chance to look into either for a couple of weeks though - I’ve got a few commitments in real life at the mo.
Once I’m back to normality I’ll take a look and try to get on top of things, but it’ll probably be in the second half on Jan.

(To any Magento programmers out there that use this extension - the code’s up on github so if you can contribute please get in touch. The more help the merrier)

Cheers,
Matt

 
Magento Community Magento Community
Magento Community
Magento Community
 
Quiddity
Jr. Member
 
Total Posts:  22
Joined:  2008-06-13
 

Matt,
I want to praise you on a great extension.  But after i updated to 1.2.0.1, the price changes to the simple products “regular” price not its “special” price if available. Do you have any clue why?

Thx in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Matt Dean
Guru
 
Avatar
Total Posts:  549
Joined:  2008-05-27
 

Hi Quiddity,

I’ve not had chance to take a look at Magento 1.2 yet - I suppose it could be for all sorts of reasons depending on what Varien have changed in the code for that version. It’s hard to know without taking a good look at the code and at the mo I’m not able to spend the time it’d need.

I’m going to have more free time in the second half of Jan though, so by the end of Jan I hope I’ll have it working nicely with Magento 1.2.x as well as getting some bugs fixed (and maybe even an extra feature of two as time allows).

Matt

 
Magento Community Magento Community
Magento Community
Magento Community
 
PHOENIX
Guru
 
Avatar
Total Posts:  549
Joined:  2007-12-19
Stuttgart, Germany
 

I’ve probably found the problem that causes the SQL error when saving a simple product.

To fix it, open app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogIndex/Model/Mysql4/Indexer.php and replace in line 9 “store_id” with “website_id”.

Varien has changed the catalogindex_price table in version 1.2 (see CatalogIndex/sql/mysql4-upgrade-0.7.8-0.7.9.php).

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nexus Rex
Sr. Member
 
Avatar
Total Posts:  139
Joined:  2008-07-10
Utah, USA
 

Phoenix,

Agreed, your fix above worked for me.

NOTE: Refreshing Layered Navigation Indices was also broken until this one code change was made as well.

 
Magento Community Magento Community
Magento Community
Magento Community
 
wetpaint12
Jr. Member
 
Total Posts:  15
Joined:  2008-11-10
 

I have tried multiple installations, and have yet to see working results, currently the configurable objects price with no options selected is equal to the lowest price of all the simple products associated with it, to my understanding this is correct.  When an attribute for the configurable product is set or selected the price reverts to zero where it stays until its added to the cart where it reverts back to the lowest price in the associated simple products list not the child product selected with the attributes.

My backend says i am currently running version 1.1.8. any suggestions would be well appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
PHOENIX
Guru
 
Avatar
Total Posts:  549
Joined:  2007-12-19
Stuttgart, Germany
 

Do you use the theme/skin that comes with the extension (see installation instructions)?

 
Magento Community Magento Community
Magento Community
Magento Community
 
wetpaint12
Jr. Member
 
Total Posts:  15
Joined:  2008-11-10
 

I am running a custom theme not the default, i have all the files in the correct places including the price.phtml the .js and .xml file into the respective locations, www.wallchamp.com/magento

Update :  If i change the design tab on my configurable product to the extention theme, the extention works as intended, if set to my custom theme, above said happens,

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nexus Rex
Sr. Member
 
Avatar
Total Posts:  139
Joined:  2008-07-10
Utah, USA
 

It must be a problem in your custom theme from what you said above. Have you refreshed your cache? I know I had to refresh my cache the first time before it worked.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2