-
Dynamic Price Updater
Hi
I don't know if this module will be of any use to anyone but I've been asked to include it a couple of times so thought I'd release it into the wild to see if anyone can make use of it... Here's what it does:
When you have a product with attributes that alter the price this module will update the price displayed on the page instantly... This gives customers an at-a-glance price total as opposed to having to work it out themselves
The updater should (in theory) work with any amount of attributes
There is a readme included in the ZIP but installation is literally to just upload the file... It overwrites nothing, has no database hooks and is completely autonomous... if it breaks just delete the file
Currently it only works with attributes that are SELECTs... If it works for people I will update it to handle the radio boxes and checkboxes
The file can be found at
https://www.zen-cart.com/index.php?m...oducts_id=1973
A working version can be seen at http://www.studio5.uk.com/index.php?...&products_id=3
Let me know if it does/doesn't work or if anyone wants anything added or changed
Dan
-
Re: Price Updater
:thumbsup: Very nice Dan!
-
Re: Price Updater
Great contribution Dan.. thank you and adding options
for check/radio boxes would also me most welcome
:clap:
-
Re: Price Updater
Thanks!
Forgot to mention that at present the updater isn't currently currency-aware... If there is interest I will update that
This means that if your currency symbol is anything but £ you need to open the jscript_updater.php file and set the UPDATER_CURRENCY_SYMBOL constant to your currency symbol (e.g. $)
You can also alter the displayed text by changing the UPDATER_PREFIX_TEXT constant
Dan
-
Re: Price Updater
Wow! That looks great. Definitely will be an essential mod.
-
Re: Price Updater
Looking nice ... :cool:
Have you a solution to when coming from the Shopping Cart and attributes are already set so the price isn't starting at the original base but at the settings already set in the dropdowns? :smile:
-
Re: Price Updater
Quote:
Originally Posted by
Ajeh
Looking nice ... :cool:
Have you a solution to when coming from the Shopping Cart and attributes are already set so the price isn't starting at the original base but at the settings already set in the dropdowns? :smile:
Hey now that's a great idea... I will look into it
I'm trying to keep this mod as simple as possible (1 file, no adjustments) but I reckon that should be doable... I'll get the radio/check boxes working then I'll get onto a 'memory' for added products :smile:
Thanks for the feedback... Looks like this might be worth building on
Dan
-
Re: Price Updater
Most definitely worth building ... many would like to see something like this work ...
-
Re: Price Updater
That's good to hear... I genuinely thought it would be one of those things that only clients of ours would want lol
Good news is I can update pre-selected attributes fairly easily... Should have that implemented over the weekend along with, hopefully, support for the other attribute types
Watch this space and thanks to all for the positive feedback (especially at this early stage)
Dan
-
Re: Price Updater
I've updated the updater to handle previously set attributes (e.g. a customer clicking from their shopping cart)... As before the updater doesn't care where its values come from; it just 'reads' the page (sorta)
One thing to note is that if you add a product to the cart then revisit that product through the normal channels (i.e. not clicking from the cart) the price will show as the starting price and the updater will not attempt to reconstruct the values in the cart... I consider this to be natural enough behaviour... A product with attributes can be ordered many times with different attributes for each shopping cart item... The updater respects this
The link for the mod is http://chrome.me.uk/PriceUpdater.zip
A working version is here http://www.studio5.uk.com/index.php?...&products_id=3 (this is always up-to-date because it's my testing ground for this)
Dan
-
Re: Dynamic Price Updater
umm ... sorta ... getting a bit too much on the price there ... :unsure:
-
Re: Dynamic Price Updater
Yikes I've broken something!
Er fixy time
Dan
-
Re: Dynamic Price Updater
You just added the selected attributes to the already calculated price ... :eek:
-
Re: Dynamic Price Updater
yeps- little whoops when you go back to the Prod_Info from the cart - i.e. I have $20.50 in my cart I go back to the page I see $32.50 ...
-
Re: Price Updater
Quote:
Originally Posted by
Chrome
I genuinely thought it would be one of those things that only clients of ours would want lol
No way! I am so glad to see this feature. Eventually this should be part of the core code as it doesn't make sense to force customers to do the math themselves (or have to add it to the cart to figure it out).
Thanks a ton. I will implement it and report my results.
On your test site, I found that if I added something to the cart (i.e. $8 base price, $30 with attributes), and then followed the cart link back to the product page, the attributes are still selected, but only base price shows until you make a new selection.
-
Re: Dynamic Price Updater
For some reason the onload is firing twice... fixeded now
File at the same place (http://chrome.me.uk/PriceUpdater.zip)
Sorry 'bout that
And thanks voltage... There may be some further tweaks that this mod needs that I'll fix as I get feedback... Unfortunately it is dependant on the quirks of browsers... There are some it won't work in (until I get the notification it doesn't and fix it :smile:)
Dan
-
Re: Dynamic Price Updater
:clap: that is much better
-
Re: Dynamic Price Updater
Now to really mess with your head ...
Add to Cart ... prices good ...
Come from Cart ... prices good ...
Change attributes ... :eek:
Now it adds the old price plus the new attributes ... :frusty:
Ever wonder why this isn't yet done in the core? :lamo:
Thanks for working on this ... it will be great when you are done ... then I will have to really test it ... :cool:
-
Re: Dynamic Price Updater
Logic order problem
Fixed... I hope... Oh I hope lol
Let me know if anything else breaks :smile:
Dan
-
Re: Dynamic Price Updater
Well ... the good news is ... I did not break it in the first 5 seconds ... :smile:
Bad news is ... I still have 101 tests to try to really mangle the heck out of this nifty add-on ... :eek:
So far it looks good ... thanks for the effort in getting this on track ... :smile:
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
Ajeh
So far it looks good ... thanks for the effort in getting this on track ... :smile:
Wow that is high praise... Thanks :smile:
If you don't find 101 faults I'll be surprised lol... Please don't BrowserPool me :smile:
Thanks for all the feedback and I'll try to address any faults or additions as quickly as I can
Dan
-
Re: Dynamic Price Updater
Lucky for you Dan I am very limited these days on my time on the forum due to my mom's health ... but I will get around to breaking ... er ... testing this when I can ... :lamo:
-
Re: Dynamic Price Updater
I hope your Mum will be ok, Ajeh
I have added what could possibly be a totally pointless addition to the Updater... For this reason I've made it switch off and on-able
When a user selects an attribute a sidebox is created that displays information of all selected attributes including their prices and a total... The sidebox can be placed anywhere in either the left or right column or switched off entirely... At the moment this is purely proof of concept and lives only on my test site... Once I've had a chance to test more thoroughly I'll include it in the downloadable file... Even if it's never used it can still stay there :smile:
To see a working version please visit http://www.studio5.uk.com/index.php?...&products_id=3
When you select an attribute the Price Updater sidebox will apear (in theory :smile:) in the left column above Information... This has been tested in IE7, FF2 and Opera9... It also still works with products from the shopping cart
Installation will remain exactly as before: just upload the file
CSS declarations can be attached to the sidebox in the normal way (base ID is updaterSB)
Please test it if anyone has time and let me know any thoughts or problems
Oh, I haven't forgotten about the radio/check box awareness of Updater; I just haven't got any products that have those particular types of attribute yet... I may well set this up tonight and see if I can get it working
Dan
-
Re: Dynamic Price Updater
Visited, tested, working fine using attributes allowed for selection..
Tried several options...
Brilliant idea.. appearance of side box is an excellent addition..
Thanks for sharing..look forward to this new release.
:clap:
-
Re: Dynamic Price Updater
Thanks Misty :smile:
Based on your response I've tidied up the code a bit and added to the readme included in the ZIP
The file, as ever, can be found at http://chrome.me.uk/PriceUpdater.zip
As stated installation is as easy as before
Please let me know any problems or thoughts
Dan
-
Re: Dynamic Price Updater
Thanks Dan..if/when you add radio/checkbox option, could you
announce in this thread please? No rush..any spare few minutes
you may get is fine...
-
Re: Dynamic Price Updater
Did a lot of work on this last night... While configuring for radio/checkboxes I enountered loads of issues, which I hope are now fixed... Here's a list of changes:
Updater can now identify all (I think) attribute types
As well as being able to add attribute values, Updater can now subtract negative values and alter the base price (if product is priced by attributes)
Subtracted values are shown in red in the sidebox
There is at least one issue that I know of and that is items in a sale don't work (yet)... This is because the updater can't 'read' the price from the header... I'll fix this soon (I hope)
Could I please ask for some testing on this? I've tried as many options as I can but there's no substitute for external input :smile:... I've put up a test shop at http://chrome.me.uk/shopdev/ for the new features (didn't want to risk anything on a live shop)
If there don't appear to be any issues with this current version I will add the feature that links to the Quantity box and release a tentative full version
Thanks all
Dan
-
Re: Dynamic Price Updater
It seems to work here.
http://chrome.me.uk/shopdev/index.ph...products_id=36
The radio buttons, and drop down list both dynamically update the price.
However, it does not appear to work here:
http://chrome.me.uk/shopdev/index.ph...products_id=97
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
enderandrew
Aha... Now you have found the Achilles heel of the Updater... It currently can't read from pages that have a discount on them... In these circumstances the Updater won't load (it will gracefully exit)
This is something I'll (hopefully) get working over the next day or 2
Thanks for the feedback!
Dan
-
Re: Dynamic Price Updater
I tested it quite a bit on the demo site, and that seemed to be the only snag. I installed an earlier version of this, and I look forward to the updated version.
Thank you for the work!
-
Re: Dynamic Price Updater
Updated file for download at http://chrome.me.uk/PriceUpdater.zip
There are 2 files included (/includes/modules/pages/product_info/)... jscript_updater.php and jscript_updater_new.php
The _new file includes the radio/checkbox capabilities and is currently very much in test mode... Delete the file you do not want to use then upload the one you do want to use and that's all
If you have downloaded a previous version and have it in place I recommend renaming the original file (j_script_updater.php is a good choice) then uploading the new file... This means if any issues arise restoring the original configuration should be easy
For clarification, at this point there are 2 known issues: Doesn't work for items on sale; Doesn't identify multiple cart additions... These are in the pipeline
Any feedback or bug reports would be greatly appreciated
Dan
-
Re: Dynamic Price Updater
I've posted (yet another) update for this mod (http://chrome.me.uk/PriceUpdater.zip) which can be seen working at http://chrome.me.uk/shopdev/
Hopefully I've fixed a few problems (most likely created a few more)... The Updater can now work with [some] sales and is quantity-aware
Prices will take into account the quantity the user has specified and adjust themselves accordingly... The quantities can be displayed in the main price header and the sidebox (these can be switched on or off independently)... Read the included readme for more information or post here if what I've written doesn't make sense :smile:
The Updater should now be aware of all radio/checkboxes
Also I've updated so that, hopefully, the currency shouldn't be an issue
Yet again, all feedback and bug reports are very much appreciated and I thank you all for your patience
Dan
-
Re: Dynamic Price Updater
Not keen on Priced by Attribute ... :cry:
The Gift Certificates with attributes is a good example ...
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
Ajeh
Not keen on Priced by Attribute ... :cry:
The Gift Certificates with attributes is a good example ...
Interesting point there because the product is listed as starting at 5 then the 1st attribute says 5 (+5)
To my mind the first attribute should be 5 (+0) as nothing is being added to the base price... Second attrib would then be 10 (+5), 15 (+10) etc.
That's how I coded Updater to function (technically, the Updater finds 2 values but offers precedence to the value in parantheses for the above reason)
at http://chrome.me.uk/shopdev/index.ph...products_id=36 the base price is adjusted but no price adjustment (from base) is listed
I have to admit I'm hazy on the attributes and GVs so I've based the logic model on what I've seen
If I've got it a bit wrong I will recheck my regex's and release a new version :smile:
Cheers for the feedback!
Dan
-
Re: Dynamic Price Updater
The Priced by Attribute is usually products_price 0.00 where the lowest price of each Option Name(s) Option Value is used to make the base price ...
Probably that product should be done without the prefixes on the attributes to avoid visual confusion ... :smile:
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
Ajeh
The Priced by Attribute is usually products_price 0.00 where the lowest price of each Option Name(s) Option Value is used to make the base price ...
Probably that product should be done without the prefixes on the attributes to avoid visual confusion ... :smile:
Incidentally, the removal of visual confusion would also fix the Updater... It uses the +, - or lack of prefix as the definitions of how the value should be handled
I just threw the default products included with the installation in there so I had something to work with
I'll do some more investigating and strengthen some of the routines
Thanks!
Dan
-
Re: Dynamic Price Updater
That could run into issues ...
Some sites use the + or blank for add and the only guarantee on a prefix is where - means subtract ...
Again we run into the visual issue here ... :blink:
This is one of the reasons the IF on attributes was switched way back in v1.x to be if negative do this otherwise do that ... so the default would be add ...
-
Re: Dynamic Price Updater
Ah
So it seems the Updater is doomed to only work with some installations
Without being able to rely on the prefix, and owing to the way it works, the Updater can never be guaranteed to be stable
Oh well, it was a nice idea... I'll leave the file in place so people can try it to see if it works for them... I'll continue to offer support here and additions if anyone wants them
Dan
-
Re: Dynamic Price Updater
Bet this means you don't want me to even mention TEXT attributes charged by letter or word, eh? :lamo:
Ain't if fun to be a coder?! :blink:
-
Re: Dynamic Price Updater
Aha! I'd spotted the text attributes and was scratching my head for a theory... I had half of one but hey lol
Yep coding is ace :smile: lol
Dan
-
Re: Dynamic Price Updater
That is more or less the purpose of this product ...
http://chrome.me.uk/shopdev/index.ph...products_id=34
Just something to really boggle the mind and test attributes out ... how hard can they be? :frusty:
-
Re: Dynamic Price Updater
I started searching for a Price Updater for the Attribute values, and lucky me, this was only posted a few days ago! Thanks!!
Have a few questions though...
How do I take off the (1) that shows up when the price is updated? Also, how would I take off the Attribute prices "(+$5)". I really don't see the need for that anymore since I've got this installed now.
-
Re: Dynamic Price Updater
Hi!
The (1) that's shown is the quantity... to disable it open up includes/modules/pages/product_info/jscript_updater.php and find the line that says:
var showQuantity = true;
Change the true to false... If you don't want the quantity to show up in the sidebox, adjust the line directly below this:
var showQuantitySB = true;
Again, change the true to false
Don't remove the (+$5) from your attributes... the Updater reads those values and makes its adjustments based on them
HTH
Dan
-
Re: Dynamic Price Updater
-
Re: Dynamic Price Updater
Please forgive my ignorance, I am a fledgling coder and even that is giving myself too much credit. :smile:
With regards to the text attributes, why can't the updater code recognise each character, if priced per character, or sentance if priced that way, and add the per letter or line charge to the price?
Is there a way that an attribute can have a certain visual like no + or - but unseen to the user there is still that + or - attribute for the code to read? Or am I just showing my glaring deficiency of knowledge here?:smile:
Thanks for working on this, I am going to try it on my test site, I think it's a brilliant idea!
Matt
-
Re: Dynamic Price Updater
Hi and thanks Matt!
The only reason there is no plug in to the text attributes is that I haven't done it yet
It's not actually a difficult thing to do, more time-consuming, but I decided to leave it for now while I have a word with another developer about feeding the vars into the JS from the backend framework (I have some theories here)
There should, in theory, be another release of this soon... If I get bored I may well add the text attribute reader just to see if I can... As long as it's recognised that this mod is pretty much experimental and may not work for some I'll add bits and pieces to it
Feel free to mess about with the code if it's of any worth to you :smile:
Dan
-
Re: Dynamic Price Updater
Just a reminder on TEXT Attributes ...
TEXT attributes are priced by fixed price, word or letter with free XX words or XX letters not counting spaces or counting spaces ... don't forget the returns should not count when a TEXTAREA ...
Did I leave anything out? :eek:
Good news ... there is a ... umm ... unexpected feature ... on TEXTAREA to do with enters and spaces that has been fixed in the upcoming Zen Cart v1.3.8 release ...
Might want to kind of hold off on this aspect for the moment so you aren't re-writting it 27 times ... :cool:
-
Re: Dynamic Price Updater
Thanks for reminding me how sneaky those attributes are lol
And I think you mean rewriting *another* 27 times :smile:
I'll wait for the upcoming release as it provides an excellent excuse to spend a load of time scratching my head wondering how this is going to work
-
Re: Dynamic Price Updater
Ain't I the helpful one?! :smartalec:
-
Re: Dynamic Price Updater
Hi All,
Great looking code!
However, I have a little problem..
I have a service which prices the product based on a customer selectable number. ( effectively a quantity. )
I've set up a drop down list with all the modifiers to the price ( Value 0,* 12, offset 0 ) This gives me the list I'm looking for. I've set the product to be priced by attribute, and everything looks great on the product page. However, when I move on to the order page, it has added the original price to the order.
I checked the javascript, and added some debug code to display the original price beside the new price, and it was zero. So, it seems like the javascript is not finding the original price.
Thats one issue.
Another issue is that I'm unable to add multiple selections of the same type.
It looks like I can have one dropdown and one radio, but not two dropdowns.
I have tested both dropdown lists independently, and both work alone, but not on the same page.
Now, I can achieve the desired effect by manually setting each of the dropdown values, but the idea is to save massive amounts of time by setting a 'hidden' base value, and only change a few entries instead of several hundred.
Could you assist me in figuring out the best method of handling these issues?
Thanks!
Chumly
-
Re: Dynamic Price Updater
Nicely done. An extremely skillful application of DOM traversal. But there are a couple of outstanding issues:
- sales and specials seem to break it.
- sideboxes with radio buttons seem to break it.
I just skimmed the thread quickly and I apologize if someone else has already mentioned these items.
Scott
PS> I thought the use of innerHTML was unsafe in FF and friends, but it seems to work in my FC4/FF 1.5 and Win/FF 2, so there you are.
-
Re: Dynamic Price Updater
Hi
Sorry for the lateness of my reply
First off thanks Chumly and Scott for your comments, which I'll deal with in order
Chumly: Do you have some links to pages that are failing? I know why your first problem is happening but the Updater should certainly be able to handle multiple instances of, say, a radio box
Scott
1st issue: Yeah, basically this is because the base price 'finder' is inefficient... I'm working on a way round this (there is another way but I really don't want this mod to be affecting other ZC files)
2nd issue: I have noticed this but it seems to be a bit spurious... After reading your post it occurred to me that I could probably avoid this by narrowing the scope of the traversal... Testing ahoy
As for the innerHTML issue: There is a small comment near the bottom of the script that admits that innerHTML is cheating :smile:... Essentially I think innerHTML is a Microsoft creation... Issues arise in standards compliant browsers when the innerHTML applied contains HTML which needs to be accessed using DOM methods... IE will parse and format the contents of innerHTML and place them into the DOM tree whereas FF et al will not
Dan
-
Re: Dynamic Price Updater
Chrome: Do you have any interest in updating this module / writing a new module to pull from the backend instead of visual identifiers?
Either way, thanks for a great mod. It has been a lot of help for me and my projects.
-
Re: Dynamic Price Updater
This is great. I do have a bug I think. I keep getting a price = $NaN what would that be from. I am using some larger numbers so I don 't know if that effects it. Thanks for the help. Here is an example of where I am using it . http://se2labs.bluesunhosting.com/ca...ecff22e082eabe
-
Re: Dynamic Price Updater
Hi
Allusiv: Yes I do plan to use vars handed from the back-end rather than relying on the 'page reading' method, but only for certain values... Not sure which yet and also not quite sure how lol... I think the base price and the attribute actuators are the values I really need (as Ajeh has pointed out the attributes can be sneaky and the page may not provide a stable visual reference as to what, exactly, they are doing)
blakems: I know what is wrong with your site (nice looking by the way): The comma in the price... The system looks for numeric values only separated by a decimal point; I completely forgot that prices could go so high that a comma will be included... D'oh!
I'll get that fixed and issue an update... Watch this space!
blakems I will note that you have included the ZenID string in your URL... Always remove that bit! It can be [potentially] used to steal a session or some other XSS exploit... Best to be on the safe side :smile:
Thanks all for the great feedback
Dan
-
Re: Dynamic Price Updater
Hi
I've released an updated version of the Updater at the usual link (will include it at the end of this post)
Commas should now pose no problem for the base price reader... I hope :smile:
I've also including a debug message system... If there any problems or issues with the Updater open the file in your favourite editor and find the following line:
var _debug = false;
Change the false to true and each time the Updater does something it will show in the debug message list below the product description (and any attributes)... To clear the list click on the debug message box title
This should help track down what's going on without having to insert alert() calls throughout the code
You can see the Updater in debug mode here: http://chrome.me.uk/shopdev/index.ph...products_id=36
Dan
http://chrome.me.uk/PriceUpdater.zip
-
Re: Dynamic Price Updater
Thanks chrome, I will update the code and let you know how it goes.
Also, thanks for the tip on the session ID—I wish it wasn't stored in the URI
-
Re: Dynamic Price Updater
That does work with the update. Is there a way to add the commas back into the numbers—make them look pretty again?
-
Re: Dynamic Price Updater
Hi
Glad that worked... As requested the commas are back
New file at the same link (above)
Dan
-
Re: Dynamic Price Updater
Can you get this working for radio buttons yet? Take a look at why I need it... http://www.printsxpress.com/index.ph...&products_id=1
My different print sizes would work best if in radio form.
-
Re: Dynamic Price Updater
Hi
The Updater should already be capable of understanding radio boxes
Give it a try... If it doesn't work post a link to the failing page here (or PM it to me) and I'll take a look
Dan
-
Re: Dynamic Price Updater
Here you go
http://www.printsxpress.com/index.ph...&products_id=1
Notice the 2 sizes 8x10 and 10x10. I need to add about 20 more sizes but I would like to make sure this will work first.
Thanks for your time
Jeff
-
Re: Dynamic Price Updater
Hi Jeff
I think the problem here *might* be the line-break in the LABEL text
Can you try removing that and seeing what happens? If this does fix the problem I'll write a quick codefix and upload it
If that doesn't work could you switch on the debug function (instructions are a page or 2 back)? That may help track down the issue
Cheers
Dan
-
Re: Dynamic Price Updater
I changed it to now read "Size" instead of 3 different words. I still does not work. I'll set up the debug when i get back from lunch.
thanks for your time
-
Re: Dynamic Price Updater
Hi
Slight misunderstanding here I think... When I said LABEL (capitalised as it's an HTML element) I meant the bit that says, e.g., 8"x10" (+$79.00)
The line-break appears between the 8"x10" and the (+$79.00) bits
The updater should be able to read the line-break but I don't think it is for some reason (as the BR is an HTML element, it's probably breaking the text into 2 distinct nodes, of which only one is being read... Thinking aloud :smile:)
I would say to drop the BR in the attribute name and see what happens... If this isn't possible or doesn't work switch on the debug and we'll go from there
HTH
Dan
-
Re: Dynamic Price Updater
OK, I turned on debug mode. Check it out again at http://www.printsxpress.com/index.ph...&products_id=1
Sorry to bother you, I know you must be quite busy
-
Re: Dynamic Price Updater
Hi
I've had a look at the page and have noticed you've added a lot of radios and removed the break from the LABELs... That seems to have fixed it from what I can see
I think it's safe to turn the debug mode off now :smile:
If you want the sidebox to show up find this line:
var _sidebox = 'information';
I'd recommend changing the 'information' to 'whatsnew'
That should force the Updater sidebox to appear above the New Products sidebox
HTH and let me know how you get on
Dan
-
Re: Dynamic Price Updater
I actually have another issue. My pricing for this product is controlled by the attributes. Do you notice that the price that shows up is incorrect?
Notice how when you go to the page it does indeed reflect the lowest attribute price. As soon as you check on another print size it appends the cost instead of just changing it. Do you have a suggestion on this?
-
Re: Dynamic Price Updater
Yeah I have seen this issue before... It's down to the way the Updater reads the attributes... I'm waiting for 1.3.8 to really get to fixing that (largely because I don't have it quite sorted yet :smile:)
For now there are 2 solutions I can suggest, though neither are a satisfactory long term remedy
1 - Set the base price of the product to 0 and preselect the lowest attribute (so the starting price would be $0.00 but the 8"x10" radio is selected)
2 - I don't actually know how to do this but I think you can remove the + displayed in the price of the attribute (so it shows as ($83.99) rather than (+$83.99))... This forces the Updater to treat the price as a base price adjustment
If neither of these work for any reason or you're not able to implement them let me know and I'll sort something out for you
Sorry about that
Dan
-
Re: Dynamic Price Updater
Well, I already tried suggestion 1 and can't figure out #2. Also didn't find in any threads. hmmm. Sorry to be a bother my friend. You are most helpful.
Jeff
:smartalec:
-
1 Attachment(s)
Re: Dynamic Price Updater
Having had a look around, I think I've found the answer to option #2
In the attributes controller, under Price and Weight, there are 2 INPUT fields that allow you to control the price... One of these boxes (the one on the left) contains a + symbol... deleting that on your attributes should, I think, have the desired effect
I've attached a little image to the post so you can see where I'm talking about :smile:
Hope that works... Let me know :smile:
Dan
-
Re: Dynamic Price Updater
Well, I think you have done it! Take a look at http://www.printsxpress.com/index.ph...&products_id=1
I turned OFF all of the + signs at appropriate attributes. However, I left a plus sign on the attribute for Sawtooth Hanger since I do want that to add on a cost of $4.00
Finally, I made 8"x10" attribute the "default" selection.
There we have it.
So far so good and I can't thank you enough.
I'll let you know if I come accross anything else like this. Is 1.3.8 coming soon? I hear it is basically bug fixes.
-
Re: Dynamic Price Updater
I'm glad that worked :smile:... it was an education for me as well
I don't know the release date of 1.3.8 I'm afraid... But I think you're right and it's mostly bugfixes
One of the bugs that is due to be fixed relates to attributes that use textareas (IIRC), which prompted me to hang fire with true code updates (it is the plan that the Updater will work with any and all attributes)
Let me know if you do have any more trouble... I know the Updater can be a bit quirky so I'll support it as best I can
Dan
-
Re: Dynamic Price Updater
I'm having problems getting this to work. I keep getting errors when selecting a radio button, it says "undefined(price)undefined(quanitity)" and the sidebox says chrome has broken something. I am running this on a xampp test server on my local computer so you can't see what's going on. I enabled debug and here's what it says:
Code:
Onload quantity: Cart add INPUT discovered (1)
Onload base price: Price found: 12.5
Onload RAD/CH: Price found: 12.5
Onload RAD/CH: Price found: 12.5
Onload RAD/CH: Price found: 12.5
Onload RAD/CH: Name - id[1] : ID - attrib-1-1
Onload RAD/CH: Name - id[1] : ID - attrib-1-2 : Adjusted!
Onload RAD/CH: Name - id[1] : ID - attrib-1-3 : Adjusted!
Onload RAD/CH:
Onload RAD/CH:
Onload RAD/CH:
Onload RAD/CH: Name - id[1] : ID - attrib-1-1
Onload RAD/CH: Name - id[1] : ID - attrib-1-2 : Adjusted!
Onload RAD/CH: Name - id[1] : ID - attrib-1-3 : Adjusted!
Onload: --- End of loading procedures ---
updateR: *Adj* - Radio - Name: id[1] - Price adjust: 17.5 - Mode:
updatePriceNow: Item: brass - Mode: Base - Altering base to 17.5
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
createSB: Sidebox created!
This happens with both IE7 and the latest version of FireFox. It seems as if there is something funny going on with my local computer because I have a problem with the jscript in xsell advanced, too. When I loaded xsell advanced and price updater onto the live remote server the js works for both mods in both browsers.
Do you have any ideas as to why it doesn't work on my localhost? I have FF configured with javascript enabled, I couldn't see where to enable it in IE7.
Another thing about Price Updater, with radio buttons at least, when you select an attribute and it updates the price and then you change it to a different attribute it sometimes sticks and the price won't change. Any ideas as to why this is happening?
I love the concept of this mod, it's super slick, so I hope that you will continue developing it. I am really impressed by your ability to create this and I hope that after a few years of self-taught nightschool I too will be able to code such innovative ideas.:smile:
Matt
-
Re: Dynamic Price Updater
Hi Matt
Thanks for the great compliment :smile:
I've got to hand it to you though, you've found a fault I have no explanation for
I know things can be a little bit weird running a local server (I run WAMPServer) but in I think honesty JS should be platform agnostic... There may be an issue in how the files are served up (maybe a headers problem... not too great with server stuff)
Does other JS run ok when served up locally?
Let me know and I'll see if I can find any info that might help
The problem with the radio boxes is something I've noticed... The issue only arises when the users clicks back onto an attribute that doesn't have a price adjustment (i.e. doesn't adjust the price)... I'd forgotten about that but I'll get it fixed over the next few days
If I'm not mistaken the settings for JS in IE are under tools -> security -> custom level... Near the bottom of that option list (enabled by default)
Dan
-
Re: Dynamic Price Updater
Well both browsers have js enabled then...
I assume that Lightbox and Image Handler 2 both use jscript and they run fine. I am having a problem with Price Updater and Just Another Cross Sell Advanced. It seems like they are both having the same or similar problems - Price Updater says undefined around the price and X Sell says addfield is not defined. So they must both work in a similar function. I guess it's no big deal since this is just a test server but I'm one of those people that can't let an unresolved issue go. :D Like a dog with a bone I guess.:laugh:
Matt
-
Re: Dynamic Price Updater
Hey
Yeah, Lightbox does use JS but I don't know what it does (never checked it out)
It seems like it's a DOM (Document Object Model) issue... Strangely it resembles the situation that arises when using innerHTML but in this case I notice it's patchy
I know what you mean though: I hate unresolved issues too, even if they seem unimportant :smile:
If I do manage to find anything out I'll post it on here
On a purely "I'm being really pedantic" point, JScript is something a bit different... Back in the Bad Old Days(tm) of the browser wars, Netscape/Mozilla and MS had their own ideas for client-side scripting... MS created JScript and NS/Mozilla created ECMAScript... They're really similar and Javascript is an umbrella term... This is a very abridged description and I'm sure if it's inaccurate a fellow pedant will correct me :smile:
All learning is good learning :smile:
Dan
-
Re: Dynamic Price Updater
I have with 3 problems with this great mod - the first 2 can do nothing about but hopefully Dan can; the third I can offer guidance for:
1. Ignores quantity discounts and therefore shows the wrong total.
2. Ignores one-time charges.
3. A client pointed out that if the price is in its usual location (i.e. up at the top of the page with the product name) then quite often the Attributes and Add to Cart sections are below the fold, so the benefits of this super mod are lost.
My solution was to copy the section for the base price display (EXCLUDING the quantity discounts section) in tpl_product_info_display.php ...
Code:
<h2 id="productPrices" class="productGeneral">
<?php
// base price
if ($show_onetime_charges_description == 'true') {
$one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
} else {
$one_time = '';
}
echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
?></h2>
and insert it closer to the Add to Cart box, giving this new element an id of productPrices2.
Then in jscript_updater.php, copy line 250 ...
Code:
document.getElementById('productPrices').innerHTML = '<?php echo UPDATER_PREFIX_TEXT; ?>' + l + addCommas(newPrice) + r + (showQuantity ? ' (' + quantity + ')' : '');
and paste it to the next line, changing productPrices to productPrices2.
You can then use css to position/style as you need.
Now what would be really neat (and I'm sure it can be done but I don't know how) is to hide this second display of the price until after a change has been made.
Because of the quantity discounts issue, I've had to remove it from the live site for now, but you can see the ide on the test site here
-
Re: Dynamic Price Updater
Hi
There is so much to Zen Cart it's difficult to remember it all lol... This mod has shown me just how flexible the system is
I need to do some research on the first 2 points but I'm sure I can sort it (at least, I hope I can lol)
The third point I'm aware of... Careful positioning of the sidebox can help with this but I'm also debating creating a 'floating' price container (like a detached sidebox) that will either stick in place when scrolling or can be dragged around
I do like the idea of the price at the bottom too... I think I'll steal the idea :D
I'll make an option to have it hidden until a change is made or to be always shown or not shown at all... I think that covers the bases :smile:
Thanks for the feedback and ideas... I'll post when an update is available... Probably over the next few days
Dan
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
Chrome
I think I'll steal the idea :D
This isn't stealing! I WANTED you to have it...and make it work in that fashion. :thumbsup:
-
Re: Dynamic Price Updater
Cheers :D... I've figured out a way to bypass altering the template file... The second price will also be move-aboutable (you can tell it where to appear on the page)
Oh, one thing I noticed on your test site is that you are getting 2 £ signs when the price adjusts... Is this a problem with the Updater? If it is I'll look into it for you
Dan
-
Re: Dynamic Price Updater
Now there's a mystery!
When I first installed it, there were NO £ signs after a change, so I edited the UPDATER_PREFIX_TEXT to include a £ sign. My client then informed me that he could see 2 £ signs, so I removed my edit...and then I couldn't see one at all.
So I put the edit back in, and that's the file currently on the test site.
It doesn't matter whether I view in FF or IE - I still seem to see one less £ sign then other people?? :huh:
-
Re: Dynamic Price Updater
Hi
Ryk, I notice the double currency symbol only shows up when the price is altered which means it is a problem with the Updater... I'll look into along with the other 8 thousand problems with this mod :laugh:
I've uploaded an updated version that includes the secondary price display... It is turn off and onable but only has 2 settings (on permanently or off)... Getting it to show up only when the price has been altered is more tricky than I thought... There are comments in the code as to how the settings work (on by default and set to appear above the 'add to cart' box) and I will update the readme as soon as I have some time
Unfortunately, the first 2 problems your initial post mentions can't be fixed in this incarnation of the Updater... They WILL be fixed in the next version (which I will start on as soon as 1.3.8 is released :smile:)
As always the Updater is at http://chrome.me.uk/PriceUpdater.zip
Dan
-
Re: Dynamic Price Updater
Excellent - keep up the good work. :thumbsup:
-
Re: Dynamic Price Updater
Hi Chrome,
and other users :)
I am from Portugal, and here the currency is euro (€). I installed the price updater on my site, zen 1.37, wth lightbox, image handler2,pc configurator and so mutch more modules and fixes that i find usefull to include on the website mechanics.
I have many problems with this module, the first one the currency, i want to change it to euros(€) but i can't find the UPDATER_CURRENCY_SYMBOL variable in the code... should i creat it?
Other problem is the value in itself, the price with a custom atribute is showed "59,169.00" insted of "591, 17€"... with the same error text message of lankeeyankee - "undefined(price)undefined(quantity)".
My log is:
Code:
Debug messages
SP Onload: Type: always
updSP: Unable to clone price node!
updSP: Duplicating price, by jove!
Onload base price: Price found: 47069
Onload RAD/CH: Price found: 47069
Onload RAD/CH: Price found: 47069
Onload RAD/CH: Price found: 47069
Onload RAD/CH: Name - id[6] : ID - attrib-6-35
Onload RAD/CH: Name - id[6] : ID - attrib-6-36 : Adjusted!
Onload RAD/CH: Name - id[6] : ID - attrib-6-37 : Adjusted!
Onload RAD/CH: Name - id[6] : ID - attrib-6-38 : Adjusted!
Onload RAD/CH: Name - id[7] : ID - attrib-7-41
Onload RAD/CH: Name - id[7] : ID - attrib-7-39 : Adjusted!
Onload RAD/CH: Name - id[7] : ID - attrib-7-40 : Adjusted!
Onload RAD/CH:
Onload RAD/CH:
Onload RAD/CH:
Onload RAD/CH: Name - id[6] : ID - attrib-6-35
Onload RAD/CH: Name - id[6] : ID - attrib-6-36 : Adjusted!
Onload RAD/CH: Name - id[6] : ID - attrib-6-37 : Adjusted!
Onload RAD/CH: Name - id[6] : ID - attrib-6-38 : Adjusted!
Onload RAD/CH: Name - id[7] : ID - attrib-7-41
Onload RAD/CH: Name - id[7] : ID - attrib-7-39 : Adjusted!
Onload RAD/CH: Name - id[7] : ID - attrib-7-40 : Adjusted!
Onload: --- End of loading procedures ---
updateR: *Adj* - Radio - Name: id[6] - Price adjust: 12100 - Mode: +
updatePriceNow: Item: Opcção 1 - Mode: Add - totalAdj: 0 - Adding 12100
updatePriceNow: Item: undefined -
updatePriceNow: Item: undefined -
Also another issue is, how disable the bottom table generated by the dinamic price updater in every product?
I instaled the last version of the module, i found it on the threat #83.
You could see this on here
Thank you for the suport, you have done a great work on the code, and created a "must be" on zen cart basic featurs.
Diogo Paiva
-
Re: Dynamic Price Updater
For me it is doing the same...I dont understand it..it was OK, and after I changed default language and currency it is broken....
-
Re: Dynamic Price Updater
Hi
Sorry for taking so long to reply
I've been studying this and I think I know the problem
Unfortunately it's not an easy fix... I'm going to research this more over the next few days
Sorry for the inconvenience and thanks for the feedback
Dan
-
Re: Dynamic Price Updater
:bigups:AWESOME MOD!!!:bigups:
I am new to Zen Cart, but I am learning. I added this mod to our site and it works almost flawlessly. I see that in other posts, you have addressed the issue of multiple currency signs. I am seeing something a little different.
If I change an attribute of an item to one with a different price adder, everything goes just beautifully. If I change the attribute back to one with no price adder, the Dollar Sign goes away.
??????
-
Re: Dynamic Price Updater
Hi
Can you post a link?
Cheers
Dan
-
Re: Dynamic Price Updater
Dan,
The link is at:
http://www.ikonprint.com
A little history....
I am not using the side box, just the dynamically updating "starting price/your price".
The best way to show you what is going on,
1.) pick brochures on the left
2.) look at starting price
3.) choose "gate fold" from the folding options dropdown
4.) the starting price changes to your price and everything is cool
now...
5.) choose "tri fold" and....poof....no dollar sigs!
6.) choose "double parallel fold" and....poof....they are back!!!
Thanks for the quick response
-Chip
-
Re: Dynamic Price Updater
It is possible to use priceupdater not only for radio select but also for dropdown?
-
Re: Dynamic Price Updater
I am using it for dropdown choices, and it works very well.
-
Re: Dynamic Price Updater
I'm having issues with Radio buttons and attribute images. As you suggested, it must be an issue with the attribute name as the Number 1 style for Radio display sort of works but any style after that does not. It's how the attribute name is displayed in accordance to the attribute image.
It would also be nice if the updater worked with the Quantity box. Then I could price one unit and the quantity box would multiply the price.
Other than that, awesome mod. Definitely should be a core feature.
-
Re: Dynamic Price Updater
Hi
Sorry I've not had any time to work with the Updater over the past few days (or even to respond on here)
miweb if you have a page that you can link to that you are having trouble with I can try to quick fix it :smile:
ebscreen thanks :D... Odd, the Updater certainly should work with multiple quantities... Can you link me up? I'll have a look... It would help also if you could turn debug mode on (there is a post about it somewhere on the thread but if you can't find it let me know)
Thanks for the feedback
Dan
-
Re: Dynamic Price Updater
Dan,
Please don't strain yourself, you have made a wonderful contribution as is.
I just started looking through the file, and noticed that:
var showQuantity
had been set to false, hence I wasn't seeing quantity updates.
Still working on the attributes/image problem. I currently have it set to "dropdown" with images shown below. It works, but can be confusing to customers.
Thanks again.
-
Re: Dynamic Price Updater
Hey, I've been setting up this module on my store and I've have a couple questions.
- The first on is with Quantity Discounts, the store is calculating the quantity discounts properly in the shopping cart but the Price Updater does not recognize when a quantity falls within a discount range.... ie: 1-2:$10; 3-4:$8, it doesn't go down to $8 when they enter in 3 or 4 in the quantity.
(i noticed this isn't working on your site either, is there a solution for this?)
- Second is with the radiobutton attributes.... i swear it was working earlier but now the radio button attributes aren't working at all! Can you please take a look at this and see if you can figure out what I may have done wrong?
Thanks for you help, this is an awesome module. Just figuring it out.
LINK:
http://208.72.159.26/~kathy/cartb/in...products_id=15
ps... roll over the options tab to play with the attributes.
Danny
-
Re: Dynamic Price Updater
Hi
Sorry for taking so long to reply
There has been no headway as yet into the discounts portion of the script... Unfortunately time hasn't been on my side
There is definitely an error on the page you linked me too... Would it be possible for you to activate the debug mode for the Updater?
I hope I'll at least be able to help you with the radio boxes
Cheers
Dan
-
Re: Dynamic Price Updater
Hi Dan and other followers...
I needed help that i decribed on threat 85 of this post, but still not any ansewrs.
I disabled the module because it was a rubish on the store and make the costumers in mistake, the prices were all wrong and the currncy was not euro €.
Could anyone help me on that.
Thanks for all.
Diogo Paiva
-
Re: Dynamic Price Updater
Hi
And again sorry for taking so long to reply
Diogo I think that may be an issue with UTF-8 characters outside the standard A-Za-z0-9 configuration but I'm not entirely certain
I'll do my best to have a look as soon as I can (I have checked your site and can see the error)
As soon as I have any news I'll post here... Feel free to leave me a message to nudge me if I seem to be taking ages :smile:
Dan
-
Re: Dynamic Price Updater
Hi Dan,
I found out what has been causing some of the problems that some folks are having. Namely "undefined" appearing instead of the currency symbol, the prices not changing, and the broken sidebox. It is Lightbox.
I installed on a fresh install of 1.3.7.1 and it works flawlessly. So I figured that there must be conflict with other javascript and installed Image Handler 2. Price Updater still worked flawlessly. I installed Lightbox 1.4 and it went back to all of the errors I have been experiencing. I hope this helps you, or someone who knows enough about javascript, to resolve the conflict if at all possible. Do you have any idea off the top of your head whether this can be resolved or are they simply incompatible?
Another workaround I figured out, when an attribute is priced at $0, the updater wouldn't reselect that attribute if you selected another one and then went back to the $0 attribute. In attributes controller the price has 4 decimal places so put .0001 in the price column. This will only work if you have the + indicated in the box next to it. Other attributes don't need the + to work, only ones priced at less than .01. You can see this in action with multiple attributes at http://musicalinstrumentsource.com/i...&products_id=1
Thanks for this brilliant contribution! I hope that this info can help shed some light on getting it to work with Lightbox since I really need to use them both.
Matt