Forums / All Other Contributions/Addons / Dynamic Price Updater

Dynamic Price Updater

Views: 343,202

Results 121 to 140 of 1,701
12 Dec 2007, 10:10 PM
#121
chrome avatar

chrome

Zen Follower

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

Dynamic Price Updater

Hi Yellow

Sorry, I'm an idiot... I didn't spot a typo in my regular expression

The var seeker = ... line should be changed to

var seeker = new RegExp(/(\s*([+-]?)([^0-9])([0-9,]+.[0-9]+)([^0-9)])\s*)/);

That should work and I really hope it does

In theory if the updater reports it's unable to recreate the sidebox it will still run... The sideboxes in 1.3.8 are tableless and the Updater can't insert the sidebox because of this... Something else to look into :smile:

Sorry about the typo (especially if that's what it turns out to be)

Dan

12 Dec 2007, 10:15 PM
#122
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Dynamic Price Updater

Hey, you know what, it works now. You are a life saver.

So in conclusion for other people:
I modified:
/includes/modules/pages/product_info/jscript_updater.php
File the line which contains:

var seeker = new RegExp

Replace the whole line by:

var seeker = new RegExp(/\(\s*([+-]?)([^0-9]*)([0-9,]+\.[0-9]+)([^0-9)]*)\s*\)/);

If you have Lightbox installed, apply the below fix suggested by Clark:

There are two places in the code that check if: (prArr[i] !== null)
I changed these two instances to: (prArr[i] == '')

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

12 Dec 2007, 10:37 PM
#123
chrome avatar

chrome

Zen Follower

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

Re: Dynamic Price Updater

Drat, floored by a typo!

Glad that worked for you

Matt and Clark, thanks for your help... I have listed the fix in the readme file and credited you both

To make things a little easier I have updated the regular expression to match the new one I gave to Yellow... It should work with any ZC version, provided I haven't made another typo

The new file can be found at http://chrome.me.uk/PriceUpdater.zip

Thanks for all the support and feedback

Dan

13 Dec 2007, 1:33 AM
#124
pinwest avatar

pinwest

New Zenner

Join Date:
Nov 2007
Posts:
20
Plugin Contributions:
0

Re: Dynamic Price Updater

Hello Chrome,

Thank you very much for assisting Yellow1912. Yellow1912 was helping me out with my site and I do appreicate your assistance in getting the Dynamic Price Updater working in my store's environment.

David...

13 Dec 2007, 3:31 AM
#125
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Dynamic Price Updater

Chrome:

Sorry this is being such a pain

Dan

Yeah right!:laugh: I can't thank you enough for this cool mod! The community is what makes zen so great!!:yes:

I have a question or two, if I may. It seems as though the sidebox only wants to appear above a one word sidebox such as 'information' but not above 'shopping_cart'. Does anyone else experience this?

Also, how can I change it from appearing in a sidebox and instead appear in the main page? Can I set some div tags to hold the box? How would I do this?

Thanks!

Matt


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

13 Dec 2007, 7:34 PM
#126
webchills avatar

webchills

Zen Follower

Join Date:
Sep 2005
Location:
Austria
Posts:
99
Plugin Contributions:
1

Re: Dynamic Price Updater

clarkjarvis:

To correct the issue with Lightbox (assuming that is the issue) I modified the jscript_updater.php as follows:
There are two places in the code that check if: (prArr[i] !== null)
I changed these two instances to: (prArr[i] == '')

Hi Clark & Chrome
just to let you know that this fix is working fine for me (zen-cart 1.3.7 with lightbox). Glad to be able to use this excellent contribution now!
Thanks!
webchills

13 Dec 2007, 10:23 PM
#127
chrome avatar

chrome

Zen Follower

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

Re: Dynamic Price Updater

Hi

David, I thought I recognised the URL! I had a busy weekend so was planning to get round to some fixes... I'm glad it's finally working for you :smile:

Thanks Matt! :D The Updater certainly should be able to appear above any sidebox you choose... Can you set it to the sidebox you would like it to appear above then post the debug messages? Might be able to figure it from there (if not I'll need a link)

Currently the Updater can't be placed in the centre column due to the way it creates itself... It actually creates everything for itself as it goes... It may be a scoping adjustment to get it to show up in the main description... I'm definitely going to check this out as it has been mentioned before

I'm glad it's working for you Webchills :smile:... Thanks to Clark for that one, genius that he is

Thanks all again for the support and feedback

Dan

14 Dec 2007, 12:51 AM
#128
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Dynamic Price Updater

Here's something weird, I've been struggling with it for hours.....

So everything appeared to work on my super heavily modded cart with lightbox. I all happy that I can get them to work together. So I start adding new product with attributes, and guess what. The updater completely ignored the new attributes! It wouldn't even re-adjust the price "starting at" text like it usually does and didn't display the (1) next to the price. Now, when I added multiple products to the cart the updater would kick in with the right price for the default attribute but still wouldn't recognise the other attributes. I tried all sorts, but nothing worked. It was as if the updater was completely ignoring the attributes, the debugger wouldn't show them either. But the weird thing was that it was working perfect for my original test item, but when I added another attribute to that item it would ignore the new attribute. I'm tearing my hair out, was it something in the database that wasn't recognising the new attributes? I checked the database and indeed the new attributes were there. I combed through everything to make sure there weren't any differences with the new items and attributes versus the ones that were working from before. I was getting really stumped, I'm still a newbie although I am reading a lot of new programming books I'm at about Programming 202 level. Just as I was ready to stick my boot through the monitor I thought I would try one last thing.

The only difference, I realised (I wish it were 5 hours ago!), was the functioning attributes had images and all of the new ones didn't. I had regarded that as inconsequential, but lo and behold! as soon as I added attribute pictures everything started to behave again!!

I have far too many mods going to be able to decipher what is happening, so I am going to make my live test site more like my live site to see if I can figure out what is going on. At the end of the day it's no biggie because I am going to use pics with all of the attributes that the updater will care about. But I hate not knowing why something is happening the way it is, so I am chalking it up to a learning lesson! :D

So if anyone else out there that is using IH2, Lightbox and Updater has any problems like this make sure you have an attribute picture.:laugh:

Matt


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

14 Dec 2007, 12:58 AM
#129
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Dynamic Price Updater

To further my above post, here is the debugger info. The first is without attribute images:

Onload quantity: Cart add INPUT discovered (1)
Onload base price: Price found: 6.2
Onload RAD/CH: Price found: 6.2
Onload RAD/CH: Price found: 6.2
Onload RAD/CH: Price found: 6.2
Onload RAD/CH: Name - id[1] : ID - attrib-1-1
Onload RAD/CH: Name - id[1] : ID - attrib-1-2
Onload RAD/CH: Name - id[1] : ID - attrib-1-3
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
Onload RAD/CH: Name - id[1] : ID - attrib-1-3
Onload: --- End of loading procedures ---

And this one is with attribute images:

Onload quantity: Cart add INPUT discovered (1)
Onload base price: Price found: 7
Onload RAD/CH: Price found: 7
Onload RAD/CH: Price found: 7
Onload RAD/CH: Price found: 7
updateR: Adj - Radio - Name: id[1] - Price adjust: 7 - Mode:
updatePriceNow: Item:
chrome - Mode: Base - Altering base to 7
updSP: Cancelled
Onload RAD/CH: Name - id[1] : ID - attrib-1-1 : Adjusted!
Onload RAD/CH: Name - id[1] : ID - attrib-1-2 : Adjusted!
Onload RAD/CH:
Onload RAD/CH:
Onload RAD/CH:
updateR: Adj - Radio - Name: id[1] - Price adjust: 7 - Mode:
updatePriceNow: Item:
chrome - Mode: Base - Altering base to 7
updSP: Cancelled
Onload RAD/CH: Name - id[1] : ID - attrib-1-1 : Adjusted!
Onload RAD/CH: Name - id[1] : ID - attrib-1-2 : Adjusted!
Onload: --- End of loading procedures ---
updateR: Adj - Radio - Name: id[1] - Price adjust: 8 - Mode:
updatePriceNow: Item:
brass - Mode: Base - Altering base to 8
updSP: Cancelled

This could totally be something to do with my customized attributes controller and dual pricing. I am using the improved attributes controller-b with modification for adding a wholesale field. I tried to revert to the stock attributes controller but I was getting an error about the columns not lining up with the fields since the database was altered to allow the wholesale pricing and I was too rushed to try to fix that part of it since it made my whole live site go down. This will be the first area that I try to recreate in teh live test site to see if that is the issue.

Matt


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

14 Dec 2007, 1:17 AM
#130
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Dynamic Price Updater

Chrome:

The Updater certainly should be able to appear above any sidebox you choose... Can you set it to the sidebox you would like it to appear above then post the debug messages? Might be able to figure it from there (if not I'll need a link)

Here's the debugger info with the sidebox set to 'shopping_cart':

Onload quantity: Cart add INPUT discovered (1)
Onload base price: Price found: 7
Onload RAD/CH: Price found: 7
Onload RAD/CH: Price found: 7
Onload RAD/CH: Price found: 7
updateR: Adj - Radio - Name: id[1] - Price adjust: 7 - Mode:
updatePriceNow: Item:
chrome - Mode: Base - Altering base to 7
createSB: Sidebox could not be created!
updSP: Cancelled
Onload RAD/CH: Name - id[1] : ID - attrib-1-1 : Adjusted!
Onload RAD/CH: Name - id[1] : ID - attrib-1-2 : Adjusted!
Onload RAD/CH:
Onload RAD/CH:
Onload RAD/CH:
updateR: Adj - Radio - Name: id[1] - Price adjust: 7 - Mode:
updatePriceNow: Item:
chrome - Mode: Base - Altering base to 7
createSB: Sidebox could not be created!
updSP: Cancelled
Onload RAD/CH: Name - id[1] : ID - attrib-1-1 : Adjusted!
Onload RAD/CH: Name - id[1] : ID - attrib-1-2 : Adjusted!
Onload: --- End of loading procedures ---

I thought that perhaps because the shopping cart sidebox is set to appear only when there is an item in it that the updater would have a hard time placing the sidebox when the shopping cart wasn't there. So I set it to 'testimonials_manager' since that is always present but it's the same error message in the debugger. I thought that perhaps it had something to do with trying to set it in the right sidebox since the information sidebox default is on the left side in my site, but that wasn't right since I can set it above the search box in the right column. It appears that it just doesn't like the _ in the sidebox. I hope this helps shed some light. :smile:

Currently the Updater can't be placed in the centre column due to the way it creates itself... It actually creates everything for itself as it goes... It may be a scoping adjustment to get it to show up in the main description... I'm definitely going to check this out as it has been mentioned before

Let me know if you need a tester. As you can see, I'm good at breaking things!:laugh:

Javascript seems so far to be the most abstract language to wrap my head around although I am only a couple of chapters into Flanagan's Javascript book and I'm waiting for a Beginning Javascript Novice to Pro book to arrive. Like the regExp you posted is soooo abstract, I hope that after reading and studying it will all make perfect sense!:smile:

Matt


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

22 Dec 2007, 11:04 PM
#131
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Dynamic Price Updater

I think I may have found another bug? Can someone check this out and let me know if they are experiencing the same thing?

I have the latest Updater installed, I am running on 1.3.7.1, many mods including IH2 and Lightbox 1.3 that's been modified to run a slideshow with additional images.

What I am experiencing is that all product prices get altered when more than one item is selected in the "Add to cart" quantity box on the product_info_default pages. If the item is $100, if you select 2 then the price that is displayed adjusts to Your price: 2 (2).(and not to $200) I didn't think that Updater affected non-attribute products, plus it doesn't show the right price or the $. I did some testing and the incorrect price is due to the MSRP mod that I have installed, creating an item with the MSRP field left blank allows Updater to show the correct price but still without the $.

I added a non-attributed item to my live test server that has only IH2 and Updater installed and it does the same thing to the price- changes it but without the $.

I'm assuming that the conflict between MSRP and Updater has something to do with the alterations to function_lookups that MSRP creates? I would so love to get these two important mods to play together nicely, does anyone have any suggestions?

I tried an older version of Updater from September but it creates the same problem, so it's nothing to do with the latest modifications to Updater.

The debugger doesn't really show anything, but here it is with a product with MSRP:

Onload quantity: Cart add INPUT discovered (1)
Onload base price: Price found: 1
Onload RAD/CH: Price found: 1
Onload RAD/CH: Price found: 1
Onload RAD/CH: Price found: 1
Onload RAD/CH:
Onload RAD/CH:
Onload RAD/CH:
Onload: --- End of loading procedures ---
Quantity change: 10
updSP: Cancelled
Quantity change: 1
updSP: Cancelled
Quantity change: 11
updSP: Cancelled
Quantity change: 111
updSP: Cancelled
Quantity change: 11
updSP: Cancelled
Quantity change: 1
updSP: Cancelled
Quantity change: 0
updSP: Cancelled

Help, please!

Matt


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

22 Dec 2007, 11:14 PM
#132
chrome avatar

chrome

Zen Follower

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

Re: Dynamic Price Updater

Hi Matt

Sorry for not replying to your earlier posts... I just plain forgot with everything going on (Xmas and all that)

Could you possibly supply me with a link to a faulty page (if you like you can private message it to me)? I'd like to get this sorted too, especially as you've helped me so much :smile:

As for beta-testing, as soon as I have a version for you to test you will be the first to know :smile:

Cheers

Dan

23 Dec 2007, 12:20 AM
#133
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Dynamic Price Updater

Chrome:

Hi Matt

Sorry for not replying to your earlier posts... I just plain forgot with everything going on (Xmas and all that)

Could you possibly supply me with a link to a faulty page (if you like you can private message it to me)? I'd like to get this sorted too, especially as you've helped me so much :smile:

As for beta-testing, as soon as I have a version for you to test you will be the first to know :smile:

Cheers

Dan

Hey, no worries, Mate!

Go to drumfactorydirect dot com and try any product, enter more than 1 into the cart quantity box and you will see what I mean. I guess the easiest way to get to a product is to scroll down to the featured items, there are still a lot of empty categories. :smile:

The only products with attributes are drum parts/lugs/tube lugs and snare drums/Global Drum Company/Performer. They work as advertised. The one product without MSRP is drumfactorydirect dot com/index.php?main_page=product_info&cPath=1_12&products_id=1789

It prices correctly for multiple quantities but doesn't display the $.

Thanks a million!!

Matt


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

23 Dec 2007, 12:37 AM
#134
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Dynamic Price Updater

BTW, I'm not complaining about all of the prices being updated by changing the quantity in the add to cart box, I guess I was just a bit surprised, and alarmed at first since it was breaking with the MSRP mod, since I though tit only worked with products with attributes. I would like to be able to keep the ability to update all prices based on quantity chosen, I'm just in a bit of a bind since all 1900 products that are currently on the site use MSRP. I can reset them all using easypopulate but the MSRP really sets the prices off well. But if I have to choose between that and Updater I will go with Updater! :D At least until I, or we!:smile:, can figure out how to get them to behave around each other!!:laugh:

Matt


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

23 Dec 2007, 1:12 PM
#135
chrome avatar

chrome

Zen Follower

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

Re: Dynamic Price Updater

Hi Matt

I've had a look at the page and I can confirm that the issue isn't related to any other module :smile:

It's being caused by the fact that there are no select or radio/checkbox attributes on the page... The 'seeker' RegEx pulls the currency identifiers from those attributes

Essentially you have found a situation I forgot to account for :smile:

Leave it with me; I have to go do some last minute shopping (should be fun this close to Xmas)... When I get back I'll post a NastyHack™ solution before actually preparing a proper solution

I'll get back to you as soon as I have a workaround :smile:

Cheers

Dan

6 Jan 2008, 3:36 AM
#136
innovafire avatar

innovafire

New Zenner

Join Date:
Nov 2007
Location:
Pennsauken, NJ
Posts:
71
Plugin Contributions:
0

Re: Dynamic Price Updater

Firstly I'd like to say that the concept of this mod is excellent, and I could really use it for a project I have where a client is requesting this functionality.

I am having several problems with it though, as follows:

  1. I have a radio list on one page that has different side salad choices, and each of them is $2.95. But I have one option which is "none". If I choose any of the side salads it changes the price correctly, but if I then choose "none" again, the price is not changed back.

  2. On some of my products, when I click a checkbox on one of the attributes, it changes the whole price to the price of the attribute. But on other products this does not happen.

Hopefully you're coming back soon!

Chris

6 Jan 2008, 4:11 AM
#137
innovafire avatar

innovafire

New Zenner

Join Date:
Nov 2007
Location:
Pennsauken, NJ
Posts:
71
Plugin Contributions:
0

Re: Dynamic Price Updater

OK scratch problem #2. I figured that one out. Needed to have that "+" sign in the attributes page.

But the problem with the radio boxes is still there.

Chris

6 Jan 2008, 5:51 AM
#138
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Dynamic Price Updater

Try having an attribute price of $.001 for the "none" field. That should allow it to work correctly. I will have a look at my attributes setup tomorrow if this isn't working for you. There are a couple of workarounds to get this great mod to work for these situations. I have found that if you are using the MSRP mod it will give Price Updater fits.

Let me know if that helps.

Matt


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

7 Jan 2008, 2:43 AM
#139
innovafire avatar

innovafire

New Zenner

Join Date:
Nov 2007
Location:
Pennsauken, NJ
Posts:
71
Plugin Contributions:
0

Re: Dynamic Price Updater

Thanks! That solved it!

Chris

7 Jan 2008, 2:48 AM
#140
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Dynamic Price Updater

innovafire:

Thanks! That solved it!

Chris

Cool, glad that helped!:smile:

Matt


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