Zen Cart Logo
Forums / All Other Contributions/Addons / Dynamic Price Updater

Dynamic Price Updater

Views: 342,231

Results 161 to 180 of 1,701
26 Feb 2008, 09:31
#161
oneworldstudios avatar

oneworldstudios

New Zenner

Join Date:
May 2007
Posts:
47
Plugin Contributions:
0

Dynamic Price Updater

After re-reading the entire thread I re-tried the "Lightbox fix" seems to have worked.

prArr[i] == ''

This has to be inserted exactly for it to work.

28 Mar 2008, 04:54
#162
jonathanbee avatar

jonathanbee

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Dynamic Price Updater

Hi there,

Thank you for making this great code, I have been really stumped by a problem though...

My radio buttons don't cause the sidebox to change at all - not even the total changes. Only the quantity works. The Products are Priced by Attributes. There are 2 attributes, off 0 and on +8. Everything else is working, I just can't get the attributes to show up in the price.

debug:
Onload quantity: Cart add INPUT discovered (25)
Onload base price: Price found: 50
Onload RAD/CH: Price found: 50
Onload RAD/CH: Price found: 50
Onload RAD/CH: Price found: 50
Onload RAD/CH: Name - id[2] : ID - attrib-2-1
Onload RAD/CH: Name - id[2] : ID - attrib-2-6
Onload RAD/CH: Name - id[3] : ID - attrib-3-2
Onload RAD/CH: Name - id[3] : ID - attrib-3-5
Onload RAD/CH:
Onload RAD/CH:
Onload RAD/CH:
Onload RAD/CH: Name - id[2] : ID - attrib-2-1
Onload RAD/CH: Name - id[2] : ID - attrib-2-6
Onload RAD/CH: Name - id[3] : ID - attrib-3-2
Onload RAD/CH: Name - id[3] : ID - attrib-3-5
Onload: --- End of loading procedures ---

Please note, I have tried select boxes and checkboxes, none of them have an effect. Any help would be great.

28 Mar 2008, 07:34
#163
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Dynamic Price Updater

Are you using the latest version? Are you using lightbox or IH2?

I have found, at least with my heavily modified cart, that I have to have an attribute image for each attribute to get the updater to work. Give it a try. If you don't want to have images, I use a 1x1 px transparent gif image for those attributes without pics.

Another thing to try, is have +0 instead of 0, and on my cart I have to use +.0001 and then it all works fine.

Let me know if that works.

Matt

28 Mar 2008, 08:43
#164
jonathanbee avatar

jonathanbee

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Dynamic Price Updater

Thanks for your reply!

Well, I tried both but it didn't resolve the issue. I think I know what it is, this code is matching text on the page, but my text is in Japanese, this code isn't going to allow for Japanese:

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

I will try to figure it out, if anyone has a suggestion, please help.

28 Mar 2008, 09:11
#165
jonathanbee avatar

jonathanbee

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Dynamic Price Updater

Well, I changed all the attribute text to Englsh and I'm using drop downs instead. Have images on the attributes and used +0.0001 for the 0 attributes.

Now I am getting closer, but...

Onload quantity: Cart add INPUT discovered (50)
Onload base price: Price found: 50
Onload SELECT: Name - id[2] : ID - attrib-2
Onload SELECT: Name - id[3] : ID - attrib-3
Onload RAD/CH: Name - id[3] : ID - attrib-3
Onload RAD/CH: Name - id[3] : ID - attrib-3
Onload RAD/CH: Name - id[3] : ID - attrib-3
Onload SELECT: Name - id[2] : ID - attrib-2
Onload SELECT: Name - id[3] : ID - attrib-3
Onload RAD/CH: Name - id[3] : ID - attrib-3
Onload RAD/CH: Name - id[3] : ID - attrib-3
Onload RAD/CH: Name - id[3] : ID - attrib-3
Onload: --- End of loading procedures ---
updatePrice: SELECT ID attrib-2 is now NULL
createSB: Sidebox created!
updSP: Cancelled
updatePrice: SELECT ID attrib-2 is now NULL
updSP: Cancelled
updatePrice: SELECT ID attrib-3 is now NULL
updSP: Cancelled

The NULL error occurs when I toggle the drop down between values. Any ideas? My version is 1.3.0.2

30 Mar 2008, 03:29
#166
jonathanbee avatar

jonathanbee

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Dynamic Price Updater

Finally got it working. Just in case anybody else is trying to do it, to handle the yen currency, I changed the RegExp to:
new RegExp(/(\s*([+-])([0-9]+)([^0-9)?])\s)/);

Removed the 'r' value after the currency, it doesn't exist for the yen currency.

Changed:
prArr[objSel[i].id]['p'] = Number(matches[3].replace(/,/, ''));
to
prArr[objSel[i].id]['p'] = Number(matches[2].replace(/,/, ''));

and priceAdj = Number(matches[3].replace(/,/g, ''));
to
priceAdj = Number(matches[2].replace(/,/g, ''));

Anybody know how I can edit this code to recognize quantity discounts on one of the attributes?

http://www.sixcentpress.jp/stage/index.php?main_page=product_info&cPath=1&products_id=1

30 Mar 2008, 14:38
#167
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Dynamic Price Updater

I'm happy to hear that you got it working with the yen!

I think that there has always been an issue with sales and discounts. I know that the author was looking into working out those bugs but he hasn't been around much lately.

If there is any other javascript wizard that can take up the job of finishing this fantastic mod, please help us out!:smile:

31 Mar 2008, 00:08
#168
jonathanbee avatar

jonathanbee

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Dynamic Price Updater

Thanks, I got the attribute discounts working now. Just need to get the product discounts working now!

26 Apr 2008, 18:20
#169
curiosus avatar

curiosus

New Zenner

Join Date:
Mar 2008
Posts:
3
Plugin Contributions:
0

Re: Dynamic Price Updater

Hello,

I'm working on a realization of a german shop with zencart. There we change the signs for the Decimal Point and the Thousands Point at the currencies configuration. That means our Decimal Point ist "," an our Thousands Point is ".".

If I adjust this in the admin menu the dynamic price updater gives me wrong results. I've tried to edit the jscript_updater.php but without success.
from:

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

to:

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

It would be nice if anyone can help me. What changes I have to realise to get the right result.

By the way, I'm very pleased about that the download works again. Thanks to Chrome.

Curiosus

21 May 2008, 06:50
#170
exoticcorpse avatar

exoticcorpse

New Zenner

Join Date:
Jan 2008
Posts:
35
Plugin Contributions:
0

Re: Dynamic Price Updater

First of all, thanks to Chrome for the fantastic mod.
I am, however, having a few small problems with it, and after reading through the entire thread, I have not been able to find a solution. The relevant URLS are pasted below and I have switched the debugger back on.

http://buildingbadges.com/shop/100-x-2-pack-custommade-badges-p-567.html

  1. The main problem is that if any attribute is selected that has no price attached to it, the $ sign is dropped from the price. I saw this mentioned earlier in the thread (here), but it seemed to get lost amongst a myriad of requests.

http://buildingbadges.com/shop/25-x-custommade-1-badges-p-30.html

  1. On products that have no priced attributes, changing the "Add to Cart" quantity causes the price to disappear completely. It still appears in the SideBox correctly, although with no $ sign.

Debugger says the following:

Quantity change: 2
updSP: Cancelled

If anyone could offer any advice that would be most appreciated.

The mod is a great idea and I really want to put it to use on my future Zen Stores as it does exactly what I need... it's just that these little things are currently making it unusable in a live environment.

Thanks in advance.

28 May 2008, 21:53
#171
chrome avatar

chrome

Zen Follower

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

Re: Dynamic Price Updater

Hey all

Firstly, sorry for being away for so long and not moving this contribution forward or appearing to supply any support

I've finally got some free time to continue development of the Updater if anyone is interested :smile:

To start, and on request, I've fixed the bug with the fantastic disappearing currency symbol (for $ and £ at least)... There is still some work to do on other languages (especially those that include non-UK/US characters) and feedback/examples of failure would be much appreciated

I also hope to have made a start on getting discounts working... The Updater can identify a normal sale at present (by normal see here) but that's about it... But, it's a start :smile:

XHTML compliance has been knocked up a notch (bam!) with the use of the CDATA declaration and escaping of certain characters

I know I still have to

  • Address the Lightbox issue... I'd like to remove the need to replace that line
  • Get other sales working
  • Something i remembered just a moment ago but can't remember now
  • Make up for months of being completely ignorant

My test shop is currently here

As always feedback and suggestions are very welcome

Oh that's right: the new file... Dynamic Price Updater - Experimental Edition(tm)... Nearly forgot that bit

I'd like to thank exoticcorpse for testing my fixes off the forum... Also I'd like to thank Matt (that yankee bloke :wink: ) for picking up the slack during my absence

Cheers

Dan

04 Jun 2008, 07:23
#172
webchills avatar

webchills

Zen Follower

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

Re: Dynamic Price Updater

Chrome:

Oh that's right: the new file... Dynamic Price Updater - Experimental Edition(tm)... Nearly forgot that bit
Hi Chrome,
would like to try the new version, but the link is not working.
Cheers
webchills

04 Jun 2008, 08:42
#173
chrome avatar

chrome

Zen Follower

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

Re: Dynamic Price Updater

Hi

Yep sorry about that... You caught me between file renaming and posting the changes here... My fault for deciding to work shortly before my bed started calling me

I've now made the experimental Updater the only updater so please use the link in my signature... Sorry for the confusion and I'll put in place a system that helps distinguish between experimental and release versions

The news is that the Updater is currently up on ramps with bits scattered all around it... I've decided the original methods for tracking objects and rewriting page content isn't up to scratch so I've bitten the bullet an decided on a major overhaul

I'll release versions when they're ready for testing if anyone has a few spare minutes to play Guinea pig :smile:

Updated version should be heading out sometime late/shortly after the weekend (fingers crossed)

Cheers

Dan

04 Jun 2008, 14:47
#174
clarkjarvis avatar

clarkjarvis

New Zenner

Join Date:
Oct 2007
Posts:
7
Plugin Contributions:
0

Re: Dynamic Price Updater

Chrome,

Thanks for making probably the most useful add-on there is (IMO). The one complaint that I have, which seems to make the add-on difficult for most users, is the method used to create and maintain the sidebox. It's very limiting to be required to place the side box above an existing sidebox. So.... I decided to make a few modifications.
I combined your add-on with Kurio's Blank SideBox and modified the code to directly update the new sidebox. This allows the user to add, hide, place, ... the sidebox using the Admin/Tools/Layout Box Controller page. I've tested it out that best that I could and it seems to work as intended.
I'm attaching the code, all the original unnecessary code has been commented out and all additional code has been commented with the "// Clark "
Hopefully this will prove useful to all who use the Price Updater add-on
-Clark

04 Jun 2008, 15:11
#175
chrome avatar

chrome

Zen Follower

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

Re: Dynamic Price Updater

Hi

Thanks Clark :smile:, I'll grab that later this evening and have a look at it

I will concede that the operation of the sidebox is clunky, but this was one of the drawbacks to my easy-install idea... Maybe if I can switch out some usage based on what's available I can make an easier to use mod

Cheers for your work!

Watch this space

Dan

06 Jun 2008, 18:14
#176
arielon avatar

arielon

New Zenner

Join Date:
Apr 2008
Posts:
31
Plugin Contributions:
0

Re: Dynamic Price Updater

Hi Chrome:

Great mod!

I will be using it on a client's website. Currently working a bit on other things. I've started working on an "extension" to your code that would read price tables. Will post when I have more material if is of interest.

Thanks.

15 Jun 2008, 17:54
#177
arielon avatar

arielon

New Zenner

Join Date:
Apr 2008
Posts:
31
Plugin Contributions:
0

Re: Dynamic Price Updater

I'm currently working on the One Time prices product attributes for this add-on. If anyone knows if it already can do it, let me know, so I don't reinvent the wheel.

;)

15 Jun 2008, 21:56
#178
arielon avatar

arielon

New Zenner

Join Date:
Apr 2008
Posts:
31
Plugin Contributions:
0

Re: Dynamic Price Updater

Ok, guys, just for the upgrade, I post here an update of the code. Still very Beta working on it... (attributes with both one-time prices and normal prices doesn't yet work).

For it to work, you have also to include:

	foreach($quantityDiscounts as $key=>$quantityDiscount) {

    //calculations for the js code
    $js_quantity_discount[] = array( 
    												'qty' =>trim( $quantityDiscount['show_qty'], "+" ), 
    												'price' =>trim( $currencies->display_price($quantityDiscount['discounted_price'], zen_get_tax_rate($products_tax_class_id)), "$" ) 
    											);
  }
    //output for the js code
    echo '<div id="js_qty_discount">';
    foreach ($js_quantity_discount as $k=>$current_discount){
    	echo  $current_discount['qty'] . "," . $current_discount['price'] . ";";
    }
    echo '</div>';
    

on the tpl_modules_products_quantity_discounts.php file

Right now not much time to explain, so I will check later.

Again, thanks you all and Chrome for the base mod...

will be working on this...

16 Jun 2008, 15:31
#179
jill8026 avatar

jill8026

Totally Zenned

Join Date:
May 2007
Posts:
461
Plugin Contributions:
0

Re: Dynamic Price Updater

Thank you for one awesome mod!

I was just wondering, I have my attributes on a tab....is there a way to get the "force" attribute function to work when on a tab...meaning if they click on add to cart and no attributes were selected it will give them an error message....If I remove the attributes from the tab this feature works fine....but it does not seem to work when the attributes are on the tab?!?!?!

Hope this makes sense!!!

Thanks again.....this is exactly what I needed!!!

25 Jun 2008, 20:43
#180
stevenlee avatar

stevenlee

New Zenner

Join Date:
Jun 2008
Posts:
85
Plugin Contributions:
0

Re: Dynamic Price Updater

wow I have been looking for a solution like this for a while, thanks very much

can the price scroll with the page so it is always visible?

I have a long list of product options and would love it if I could get the price to scroll down so it is always visible, I know how to do absolute positioning but I would know where to start programming, I see when I save a product page page it says

<!--bof Add to Cart Box -->
      <DIV id=cartAdd>Add to Cart: <INPUT maxLength=6 size=4 value=1 
      name=cart_quantity><BR><BR><INPUT type=hidden value=180 
      name=products_id><INPUT title=" Add to Cart " type=image alt="Add to Cart" 
      src="HOPC1 [HOPC1] - $281_00  OZM Systems, Powerful Custom Computers_files/button_in_cart.gif"> 
      </DIV><!--eof Add to Cart Box-->

which is what I want to scroll, but where do I start

thanks for all of your efforts
:clap: