Forums / All Other Contributions/Addons / Dynamic Price Updater

Dynamic Price Updater

Views: 343,198

Results 41 to 60 of 1,701
18 Jul 2007, 4:04 PM
#41
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Dynamic Price Updater

That is more or less the purpose of this product ...

http://chrome.me.uk/shopdev/index.php?main_page=product_info&cPath=22&products_id=34

Just something to really boggle the mind and test attributes out ... how hard can they be? :frusty:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Jul 2007, 7:20 AM
#42
turtledove avatar

turtledove

Zen Follower

Join Date:
May 2006
Posts:
182
Plugin Contributions:
0

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.

23 Jul 2007, 9:29 AM
#43
chrome avatar

chrome

Zen Follower

Join Date:
Jul 2005
Location:
Wales, UK
Posts:
392
Plugin Contributions:
0

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

24 Jul 2007, 12:03 AM
#44
turtledove avatar

turtledove

Zen Follower

Join Date:
May 2006
Posts:
182
Plugin Contributions:
0

Re: Dynamic Price Updater

Perfect. Thanks!

25 Jul 2007, 1:25 PM
#45
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

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


Zen Cart and it's community are the best!!

25 Jul 2007, 3:26 PM
#46
chrome avatar

chrome

Zen Follower

Join Date:
Jul 2005
Location:
Wales, UK
Posts:
392
Plugin Contributions:
0

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

25 Jul 2007, 3:34 PM
#47
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 Jul 2007, 3:50 PM
#48
chrome avatar

chrome

Zen Follower

Join Date:
Jul 2005
Location:
Wales, UK
Posts:
392
Plugin Contributions:
0

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

25 Jul 2007, 3:54 PM
#49
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Dynamic Price Updater

Ain't I the helpful one?! :smartalec:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

29 Jul 2007, 5:59 PM
#50
chumly avatar

chumly

New Zenner

Join Date:
Jul 2007
Posts:
1
Plugin Contributions:
0

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

30 Jul 2007, 11:31 PM
#51
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

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.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

31 Jul 2007, 9:53 AM
#52
chrome avatar

chrome

Zen Follower

Join Date:
Jul 2005
Location:
Wales, UK
Posts:
392
Plugin Contributions:
0

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

1 Aug 2007, 6:24 PM
#53
allusiv avatar

allusiv

New Zenner

Join Date:
Jul 2007
Posts:
10
Plugin Contributions:
0

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.

10 Aug 2007, 3:51 AM
#54
blakems avatar

blakems

New Zenner

Join Date:
Nov 2005
Posts:
7
Plugin Contributions:
0

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/cart/index.php?main_page=product_info&products_id=180&zenid=ba6d00f616abc5e433ecff22e082eabe

10 Aug 2007, 1:36 PM
#55
chrome avatar

chrome

Zen Follower

Join Date:
Jul 2005
Location:
Wales, UK
Posts:
392
Plugin Contributions:
0

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

10 Aug 2007, 5:45 PM
#56
chrome avatar

chrome

Zen Follower

Join Date:
Jul 2005
Location:
Wales, UK
Posts:
392
Plugin Contributions:
0

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.php?main_page=product_info&cPath=25&products_id=36

Dan

http://chrome.me.uk/PriceUpdater.zip

12 Aug 2007, 1:47 AM
#57
blakems avatar

blakems

New Zenner

Join Date:
Nov 2005
Posts:
7
Plugin Contributions:
0

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

12 Aug 2007, 6:10 AM
#58
blakems avatar

blakems

New Zenner

Join Date:
Nov 2005
Posts:
7
Plugin Contributions:
0

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?

12 Aug 2007, 4:04 PM
#59
chrome avatar

chrome

Zen Follower

Join Date:
Jul 2005
Location:
Wales, UK
Posts:
392
Plugin Contributions:
0

Re: Dynamic Price Updater

Hi

Glad that worked... As requested the commas are back

New file at the same link (above)

Dan