New Zenner
- Join Date:
- May 2009
- Posts:
- 34
- Plugin Contributions:
- 0
Dynamic Price Updater
Thank you Mr Chrome...
let me know if you come up with a solution.
Thank you!
Views: 342,329
New Zenner
Thank you Mr Chrome...
let me know if you come up with a solution.
Thank you!
New Zenner
Hello everybody!!! I am new to zen cart. I have installed the dynamic price updater which is a very helpful app but there is a little problem. When it calculates the price it gives a result of 1% more than it should be. Does anybody know what happens? You can see it in the following link: http://www.vapepal.gr/index.php?main_page=product_info&cPath=4&products_id=33
Any help would be appreciated.
Thank you in advance,
George.
New Zenner
Hello and thanks for this great addon! I just updated to the latest version to fix some problems with sales and onetime charges.
Now DPU v2.0a (2.0.1) calculates all prices 1% too high, even the base price. All prices become correct, when added to cart. Do you have any ides how to fix this? I would appreciate your help a lot! :)
With the old version everything worked great, except when there was onetime charges included in the products - the price wasn't calculated at all. I would appreciate your help in this too, if you can help.
New Zenner
Hi Dan!
Not moaning! Just wondering if you have an update on the dual pricing?
Just curious!
Frans
Zen Follower
This mod works fabulously on items that are priced by attribute (base prices are all $0) but on my items that are not priced by attribute (they don't even have any attributes), the displayed price is incorrect (it looks like the DPU is pulling prices from the upsell sidebox and recently viewed mod).
To correct this, I have been trying to add an if statement to jscript_ajax_updater.php to keep the DPU from loading on items that have a base price of more than $0, but have thus far been unsuccessful (obviously or I wouldn't be bugging you :smile:).
The most logical if statement for me to use (I think) would be something like
$pibp = zen_get_products_base_price($pid);
if ($pibp > 0) $load = false;
but it isn't working - the script is still loading on my products that have a base price of more than $0.
Help please? Thanks in advance.
Zen Follower
Hi all
Sorry it's taken me so long to reply... That old enemy, time, has not been on my side... I have been following the trouble people are experiencing with the display price and believe me I really want to get it sorted... I know I've said this before but I intend to try and fix the problems this week
Frans, I have done some work integrating with the dual pricing mod but it statically returns the display string rather than calculated results so I've been trying to strip them down to something I can work with... I don't want to alter the dual pricing mod's code... I'll get it sorted
kamelion0927, the Updater doesn't pull its prices from anywhere: it calculates them by creating a sandboxed shopping cart object and applying the attributes to it... Heavy-lifting of the price calculations is offloaded to core routines to future-proof against core updates and updated pricing routines... Unfortunately, it appears I'm applying something incorrectly... I need to look into it
Incidentally, have you tried echoing the $pibp var to see what it contains?
Dan
Zen Follower
Chrome:
kamelion0927, the Updater doesn't pull its prices from anywhere: it calculates them by creating a sandboxed shopping cart object and applying the attributes to it... Heavy-lifting of the price calculations is offloaded to core routines to future-proof against core updates and updated pricing routines... Unfortunately, it appears I'm applying something incorrectly... I need to look into it
Incidentally, have you tried echoing the $pibp var to see what it contains?
Dan
Sorry - I'm not talented enough to be a true coder so I always forget to utilize the echo statement :D (which, incidentally, would save me a lot of time trying to figure out what parts of the code to use on if statements - time for a sticky on the monitor).
Thanks for your time! I'll try echoing the statement and see what I get.
Zen Follower
kamelion0927:
Sorry - I'm not talented enough to be a true coder so I always forget to utilize the echo statement :D (which, incidentally, would save me a lot of time trying to figure out what parts of the code to use on if statements - time for a sticky on the monitor).
Thanks for your time! I'll try echoing the statement and see what I get.
Hi
The little piece of code that I always use is
echo '<pre>';
var_dump($theVarWithNoName);
echo '</pre>';
var_dump() is great because it gives you extended information... Also the variable can be an array, object or pretty much anything really... The <pre> tag makes it nice and readable :smile:
HTH
Dan
Zen Follower
Chrome:
Hi
The little piece of code that I always use is
echo '<pre>';
var_dump($theVarWithNoName);
echo '</pre>';
> var_dump() is great because it gives you extended information... Also the variable can be an array, object or pretty much anything really... The <pre> tag makes it nice and readable :smile:
>
> HTH
>
> Dan
LOL thanks but you almost totally lost me - you have to type slowly and clearly so I can keep up. :D
I added
```php
$pibp = zen_get_products_base_price($pid);
echo '<pre>';
var_dump($pibp);
echo '</pre>';
to jscript_ajax_updater right under
$pidp = zen_get_products_display_price($pid);
if (empty($pidp)) $load = false;
and above
if ($load) {
but nothing is showing on my product info pages. Am I putting the code in incorrectly?
Zen Follower
Hi
Crikey, you're right, it's in a javascript file... You should be able to see the results in the source of page, near the top... The echo option would have the same effect... Change the code to:
echo '// DEBUG';
var_dump($pibp);
Refresh the page, view source then hit CTRL+F and search for DEBUG... Convoluted but it should get you to your data
HTH
Dan
New Zenner
Hi could some one let me know how I stop the price displaying twice with this excellent mod. thanks,
New Zenner
maxell6230:
Hi could some one let me know how I stop the price displaying twice with this excellent mod. thanks,
try this, open jscript_updater.php and find (line 35):
var _secondPrice = 'true';
and change to:
var _secondPrice = 'false';
New Zenner
ok thanks Hari changed it and it worked, although mine said var _secondPrice = 'cartAdd'; whioch I changed to false, does this make a differance?
Thanks,
New Zenner
maxell6230:
ok thanks Hari changed it and it worked, although mine said var _secondPrice = 'cartAdd'; whioch I changed to false, does this make a differance?
Thanks,
Yep, "cartadd" was correct value for that. Good that it worked for you!
New Zenner
Hi All,
Thanks for taking the time to create this awesome module.
I have uploaded all files from the zip to a website im working on. However, after the upload, I recieve an error in google chrome:
"Status returned - "
On IE, I get a constant loading picture.. circle just keeps circling..
Any ideas on how to fix the issue?
Thanks,
Lee
Zen Follower
Chrome:
Hi
Crikey, you're right, it's in a javascript file... You should be able to see the results in the source of page, near the top... The echo option would have the same effect... Change the code to:
echo '// DEBUG';
var_dump($pibp);
> Refresh the page, view source then hit CTRL+F and search for DEBUG... Convoluted but it should get you to your data
>
> HTH
>
> Dan
Convoluted is the only way to go - makes life so much more interesting. :P
When I add the debugging echo, I get // DEBUGstring(7) "15.9500" (and a whole lotta odd W3C errors). But to be honest, have no idea what the debugstring means (or what to do to correct it).
Thanks so much for your time!
Zen Follower
Hi
Lee, do you have a link? I'll check it out
kamelion, the //DEBUG bit is just the echo string to find the output in the code... The var_dump() follows straight after and is saying the variable is a string, 7 characters long and it contains "15.9500"... It's odd that the code you have used doesn't work... I'm not firing on all cylinders at the moment but try
if ((float)$pibp > 0) $load = false;
That might work; I'm pretty tired so I may be missing something else... Let me know how you get on
Cheers
Dan
Zen Follower
Chrome:
Hi
Lee, do you have a link? I'll check it out
kamelion, the //DEBUG bit is just the echo string to find the output in the code... The var_dump() follows straight after and is saying the variable is a string, 7 characters long and it contains "15.9500"... It's odd that the code you have used doesn't work... I'm not firing on all cylinders at the moment but try
if ((float)$pibp > 0) $load = false;
> That might work; I'm pretty tired so I may be missing something else... Let me know how you get on
>
> Cheers
>
> Dan
That is so nice of you to help even though you're tired. You have no idea how much I appreciate it!
I would love to put your code to the test but all the sudden this afternoon, the DPU decided to be stubborn and wouldn't work at all - even after I replaced the files with untainted ones. (I haven't made changes to any other files other than the ones specific to DPU.)
I'm getting
Error: this._responseXML.getElementsByTagName("responseType")[0] is undefined
I thought it was because I have the css/js loader installed (don't know if you're familiar with it) which runs a minify script. So to get it to play nice, I did the workaround required if there's a javascript conflict and it's still reading the whole file except for that one line...
I don't suppose you have any ideas of how to fix it?
New Zenner
Chrome:
Hi
Lee, do you have a link? I'll check it out
kamelion, the //DEBUG bit is just the echo string to find the output in the code... The var_dump() follows straight after and is saying the variable is a string, 7 characters long and it contains "15.9500"... It's odd that the code you have used doesn't work... I'm not firing on all cylinders at the moment but try
if ((float)$pibp > 0) $load = false;
> That might work; I'm pretty tired so I may be missing something else... Let me know how you get on
>
> Cheers
>
> Dan
Hi Dan,
choosemypc.com.au - PM me if you want login details... Its just a test site..
Thanks,
Lee
Zen Follower
Hi
Kamelion, The Updater is failing because somehow a blank space is the first character is the returned XML... To be honest I have no idea why that might be happening... Usually this is caused by a blank space after the ?> which ends a PHP file, but the Updater's files are left open to guard against this anomaly... Currently I couldn't say why your site is exhibiting this behaviour but I will have a think about it
Lee, that link doesn't load
Cheers
Dan
Fields marked required must be completed.
Tell staff why this post should be reviewed.