-
Re: Dynamic Price Updater
Hi Chrome, there's an option in CEON to add an exception for a file which I did for dpu_Ajax.php.
Just come across another problem I think you can help with. I've installed http://www.zen-cart.com/index.php?ma...roducts_id=994 'Attribute image replaces main product image on selecting attribute'
The problem is this is using Ajax to replace the image which is conflicting with the DPU script, when the page is loading both the attribute can be selected replacing the main image, and the price updates, but once the age loads only the price update?
Any thoughts?
Thanks
-
Re: Dynamic Price Updater
Hi Chrome, I installed the mod succesfully, it work great but with one problem...
The decimal in the price are wrong... Let me explain, an item has a price of 2.40€ (2.00+Vat 20%), when i load the product page it shows rigt but after a sec it change from 2.40 to 2.42..
It's a very little difference but it's annoying.
I'm trying to fix it meanwhile if you have suggestion will be appreciated..
p.s. Zencart last versione
Php 5.x
For now the mod is not on a live server, just testing on local so i cannot link it.
-
Re: Dynamic Price Updater
Hi
Bigsy: This is one of the issues I'm trying to fix... There seems to be an issue with the Ajax object... I'm getting to it (need my test site back up and running first)
Izar: What value do you get if you add the item to your basket?
Cheers
Dan
-
Re: Dynamic Price Updater
The right one Chrome, the basker work perfectly.
I've upload the mod on live server, here the link
http://www.laviadellincenso.it/comme...=0&language=en
The right price are 2.40, and each attributes add a rouded value so i dont' know where the decimal came from...
Until now i didn't find any clue...
-
Re: Dynamic Price Updater
Hi
Hmm, that's an odd one... It does look like a rounding error but the Updater uses the basket code to generate the prices... I'll take a look into it on my server when it's up and running (not long now I hope)
Dan
-
Re: Dynamic Price Updater
Hmmm i'll take a look to the basket also, just a note, may it have something to do with the currency used? Or with the vat?
It' strange because the original value is rounded, 2,00 and it apply a vat of 20% so the result is yet rouded 2,40.
That 0,02 came from nowhere...
Still searching ;-)
-
Re: Dynamic Price Updater
Hi
Looking at other products it appears to be adding 0,01EUR per 1,00EUR (or there abouts)... Very odd... Again, it could be rounding
I can't look at the script at all for the moment but I will when I get home... Need to check a few things
Dan
-
Re: Dynamic Price Updater
Thank You a lot Chrome, hope to solve this soon :-)
-
Re: Dynamic Price Updater
Yup, looking forward to it!:wink:
-
Re: Dynamic Price Updater
Hi again, here some conclusions i got, unfortunatly i'm not good with java so i've not be able to spot the problem...
1. It add a 0,01 for every 1,00 (1,00 will became 1,01 - 5,00 will become 5,05...)
2. It doesn't effect the cart process, if you add product in the cart the price are right and all is fine.
3. Maybe the problem is in the jscript_ajax_updater.php
4. I try it on Mysql 4.x and 5.x with same results.
5. It effect only the product page. (Think because the module just work with it...)
no other hints at the moment :-(
-
Re: Price Updater
This was just what I was looking for, I just added custom pc's to my site, works like a charm :)
-
Re: Price Updater
would have edited but was too late, just one question, how do I get it to show below a sidebox instead of above?
TIA!
-
Re: Dynamic Price Updater
Hi again Crhome, sorry to bother you again, I wasn't able to figure out why DPU add 0,01 to every price in the product page, do you have any suggestion?
Wich file is responsable for the update of the price?
Many thanks
-
Re: Dynamic Price Updater
Hi
Newby: The sidebox has to live above another sidebox unfortunately... You can change the following line:
Code:
var _sidebox = 'manufacturers';
to state any sidebox you would like the Updater to appear above (use the ID of the sidebox)
Izar: The file which controls the price determination is in classes/dynamic_price_updater.php... Unfortunately I haven't yet solved this problem (still server issues until my site is transferred) and to be honest I'm not sure where to start... Usually I have an idea of what's wrong but this time I'm completely stumped
Thanks for your patience (again) everyone... I'll try to get this sorted ASAP
Dan
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
Chrome
Hi
Newby: The sidebox has to live above another sidebox unfortunately... You can change the following line:
Code:
var _sidebox = 'manufacturers';
to state any sidebox you would like the Updater to appear above (use the ID of the sidebox)
I saw that thanks chrome, basically where as I had it above manufacturers (default), my manufacturers box was at the top of the page (doesn't look right at the bottom), I tried to move tell a friend box to the bottom and put it above that but it didn't seem to like the spaces or using underscore to replace the space and wouldn't work.
I basically need it at the bottom as I have my attributes after the description of the base unit which customers can have the optional upgrades on, so as they are down there making changes they can't see the box, I'll just have to keep manufacturers box down the bottom, still a great addition and very much appreciated for your time to code it.
-
Re: Dynamic Price Updater
Hi Newby
The ID of the 'Tell A Friend' sidebox is 'tellafriend', no spaces or caps... Give that a try :smile:
Cheers
Dan
-
Re: Dynamic Price Updater
Hi Chrome, perhaps i found the Solution!!!
In dynamic_price_updater.php at the line 83 there is this code:
$product_check = $this->_db->Execute("select products_tax_class_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$this->_post['products_id'] . "'" . " limit 0");
I changed "limit 1" to "limit 0". Really i don't know exactly what it does but it work... the price are now correct..
The question is... which are the side effect of that change? :shocking:
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
Chrome
Hi Newby
The ID of the 'Tell A Friend' sidebox is 'tellafriend', no spaces or caps... Give that a try :smile:
Cheers
Dan
Thanks :smile:
-
Re: Dynamic Price Updater
Hi
First off, sorry all, things have been very, very busy of late... I know I've said this before but I'm going to try my best to get some new test code sorted over the next week
Izar: What you're doing there is disabling the tax... If it works for you that's great but it might indicate an issue somewhere else in the code... I'll wait for more feedback on this one as the matter of the Updater not playing with other Ajax modules is more pressing
News soon, I hope!
Dan
-
Re: Dynamic Price Updater
Thanks Dan,
Until now It work great, dunno if the problem was caused from something in the tax, i'm from Italy so i've adjust the tax rate and so on. Disabling the calculation on tax rounded the value, to be precise the tax calculated are 20% of the value, Zencart is set to display the price WITH tax included, so if I've something which cost €10,00 it will show €12,00 on the product page.
The module add a 1% to the total value so 12,00 become €12,12.
Hope this will help addressing the problem in future.
-
Re: Dynamic Price Updater
Apologies if this has already been brought up, but is there any code changes available to make this work with qty discounts?
Cheers Chrome!
-
Re: Dynamic Price Updater
Hi OJM
It depends which version of the Updater you're using... V2 should handle quantity discounts out of the box while V1 wasn't capable of any discounts at all
HTH
Dan
-
Re: Dynamic Price Updater
I have installed the DPUv2 and it seems to work great! However I just initiated a sale price on all of my products and the sale price does not reflect in the update. See here
Maybe I jsut set up the options wrong... not quite sure..
-
Re: Dynamic Price Updater
Never mind... Just a quick setting... thx for the great mod
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
Chrome
Hi OJM
It depends which version of the Updater you're using... V2 should handle quantity discounts out of the box while V1 wasn't capable of any discounts at all
HTH
Dan
Brilliant, cheers Dan, missed the v2!
Quote:
Originally Posted by
new2u
Never mind... Just a quick setting... thx for the great mod
What setting did you have to change?
-
Re: Dynamic Price Updater
Hey Chrome, just wondering if you had gotten an update to the code yet?
-
Re: Dynamic Price Updater
I just installed this great mod and cannot get it to work with my sale price either.
My test site is here:
http://snow.byethost8.com/shop/index...&products_id=1
When the page initially loads, the price shows:
Starting at: £15.00 £6.00
Save 60% off
The £15.00 has a strikethrough.
When price updater kicks in, the price changes to:
Starting at £15.00
I've found this post which I think explains how to rectify this:
http://www.zen-cart.com/forum/showth...ale#post507151
But I was wondering if there is a better or easier way than hacking the code?
Also, is there a way to stop the price updater kicking in when I change the quantity in the add to cart box?
-
Re: Dynamic Price Updater
Hi Chrome and all...
I've installed the price updater on a couple of shops without a problem.
But now i ran into one.
It somehow doesn't work on tabbed products when the attributes are in a tab.
Is there a workaround or a quick fix?
TIA, eentje
-
Re: Dynamic Price Updater
Thanks! :D.. I was looking for this capability. An old php shopping cart I used does that by default, which is lacking on Zen Cart.
I was looking on this forum to solve a different issue, but somehow I came across this thread, and when I read the original post, I knew I had to have it. No question about it.
I just unzipped the .zip file, then uploaded the file and two dir in about 3 seconds... went to my front page, hit Refresh, then I went to a product page, and sure enough, it updates as the attributes/options change.
This is something that should be a core part of Zen Cart.
Kevin
-
Re: Dynamic Price Updater
eentje, I think the tabs are causing the same problem for us, I'll be troubleshooting this sometime this week. If I fix the problem Ill post it. :wink:
www.ribbonsbaskets.com
-
Re: Dynamic Price Updater
we need to get this specials thing working!
:flex:
-
Re: Dynamic Price Updater
Has anyone managed to get this working with other AJAX modules, such as the attributes change main image mod?
-
Re: Dynamic Price Updater
Hi Every one!!!
My problem is that, I do my all calculation on price, but now my new price will not to add as final price as I have no idea about final price variable , that I will assigned my final value to that that variable,
my link is:- http://team-kh.awpdc.com/~zadhnanr/b...roducts_id=253
Please let me know if you have an idea about this situation.
But plz be urgent thanks.:clap:
Thanks
Zahid.
-
Re: Dynamic Price Updater
Hi all,
I've mentioned a problem I've had before but still not getting anywhere so I've decided to offer £50 sent via PayPay to whoever can fix it.
My problem is I use this mod with the 'attribute image replaces main image' mod. Both work together until the page stops loading then locks down, then only the price updates, and the image does not change?
I know its something to do with Ajax objects.
I think what needs to be done is put both Ajax requests from each mod into one. I have pasted the file including both mods which need combining to work.
I will really appreciate anyone's help, and I'm serious about the £50.
Code for DPU
##############################____
<?php
/**
* @package Dynamic Price Updater
* @copyright Dan Parry (Chrome)
* @author Dan Parry (Chrome)
* @version 2.0a (roughly)
* @contact [email protected]
* @licence This module is free to distribute and use as long as the above copyright message is left in tact
*/
// define some running vars
$load = true; // if any of the PHP conditions fail this will be set to false and DPU won't be fired up
define('DPU_PRODUCT_FORM', 'cart_quantity'); // this should never change
define('DPU_PRICE_ELEMENT_ID', 'productPrices'); // this is the ID of the element where your price is dieplayed
$load = true;
$pid = (!empty($_GET['products_id']) ? intval($_GET['products_id']) : 0);
if (0==$pid) {
$load = false;
} elseif (zen_get_products_price_is_call($pid) || zen_get_products_price_is_free($pid) || STORE_STATUS > 0) {
$load = false;
}
$pidp = zen_get_products_display_price($pid);
if (empty($pidp)) $load = false;
if ($load) {
?>
<script language="javascript" type="text/javascript">
// Hidey codey <![CDATA[
// Set some global vars
var theFormName = '<?php echo DPU_PRODUCT_FORM; ?>';
var theForm = false;
var theURL = '<?php echo DIR_WS_CATALOG; ?>dpu_ajax.php';
var _secondPrice = 'cartAdd';
var objSP = false; // please don't adjust this
var request = new Array();
function objXHR()
{ // scan the function clicked and act on it using the Ajax interthingy
var url; // URL to send HTTP requests to
var timer; // timer for timing things
var XHR; // XMLHttpRequest object
var _responseXML; // holds XML formed responses from the server
var _responseText; // holds any textual response from the server
var request; // associative array to hold requests to be sent
request = new Array();
this.createXHR();
}
objXHR.prototype.createXHR = function () { // this code has been modified from the Apple developers website
this.XHR = false;
// branch for native XMLHttpRequest object
if(window.XMLHttpRequest) { // decent, normal, law abiding browsers
try { // make sure the object can be created
this.XHR = new XMLHttpRequest();
} catch(e) { // it can't
this.XHR = false;
}
// branch for IE/Windows ActiveX version
} else if(window.ActiveXObject) { // this does stuff too
try {
this.XHR = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
this.XHR = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
this.XHR = false;
}
}
}
}
objXHR.prototype.getData = function(strMode, resFunc) { // send a request to the server in either GET or POST
strMode = (strMode.toLowerCase() == 'post' ? 'post' : 'get');
var _this = this; // scope resolution
this.createXHR();
if (this.XHR) {
this.XHR.onreadystatechange = function () {
if (_this.XHR.readyState == 4) {
// only if "OK"
if (_this.XHR.status == 200) {
_this._responseXML = _this.XHR.responseXML;
_this._responseText = _this.XHR.responseText;
_this.responseHandler(resFunc);
} else {
alert('Status returned - ' + _this.XHR.statusText);
}
}
}
this.XHR.open(strMode.toLowerCase(), this.url+(strMode.toLowerCase() == 'get' ? '?' + this.compileRequest() : ''), true);
if (strMode.toLowerCase() == 'post') this.XHR.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
this.XHR.send(this.compileRequest());
} else {
var mess = "I couldn't contact the server!\n\nIf you use IE please allow ActiveX objects to run";
alert (mess);
}
}
objXHR.prototype.compileRequest = function () {
// parse the request array into a URL encoded string
var ret = ''; // return request string
for (var e in request) {
ret += e + '=' + request[e] + '&';
}
return (ret.substr(0, ret.length - 1));
}
objXHR.prototype.responseHandler = function (theFunction) { // redirect responses from the server to the right function
request = new Array();
eval('this.'+theFunction);
}
objXHR.prototype.getPrice = function () {
this.url = theURL;
var n=theForm.elements.length;
for (var i=0; i<n; i++) {
var el = theForm.elements[i];
switch (el.type) { <?php // I'm not sure this even needed as a switch; testing needed ?>
case 'select':
case 'select-one':
case 'text':
case 'hidden':
request[el.name] = escape(el.value);
break;
case 'checkbox':
case 'radio':
if (true == el.checked) request[el.name] = escape(el.value);
}
}
this.getData('post', 'handlePrice()');
}
objXHR.prototype.handlePrice = function () {
var thePrice = document.getElementById('<?php echo DPU_PRICE_ELEMENT_ID; ?>');
var type = this._responseXML.getElementsByTagName('responseType')[0].childNodes[0].nodeValue;
if (type == 'error') {
this.showErrors();
} else {
var temp = this._responseXML.getElementsByTagName('responseText');
for(var i=0, n=temp.length; i<n; i++) {
var type = temp[i].getAttribute('type');
switch (type) {<?php // the 'type' attribute defines what type of information is being provided ?>
case 'priceTotal':
thePrice.innerHTML = temp[i].childNodes[0].nodeValue;
if (_secondPrice !== false) updSP();
break;
case 'quantity':
with (temp[i].childNodes[0]) {
if (nodeValue != '') {
thePrice.innerHTML += nodeValue;
updSP();
}
}
break;
}
}
}
}
function updSP() {
// adjust the second price display; create the div if necessary
var flag = false; // error tracking flag
if (_secondPrice !== false) { // second price is active
var centre = document.getElementById('productGeneral');
var temp = document.getElementById('<?php echo DPU_PRICE_ELEMENT_ID; ?>');
var itemp = document.getElementById(_secondPrice);
if (objSP === false) { // create the second price object
if (!temp || !itemp) flag = true;
if (!flag) {
objSP = temp.cloneNode(true);
objSP.id = temp.id + 'Second';
itemp.parentNode.insertBefore(objSP, itemp.nextSibling);
}
}
objSP.innerHTML = temp.innerHTML;
}
}
objXHR.prototype.showErrors = function () {
var errorText = this._responseXML.getElementsByTagName('responseText');
var alertText = '';
var n=errorText.length;
for (var i=0; i<n; i++) {
alertText += '\n- '+errorText[i].childNodes[0].nodeValue;
}
alert ('Error! Message reads:\n\n'+alertText);
}
var xhr = new objXHR;
function init() {
var n=document.forms.length;
for (var i=0; i<n; i++) {
if (document.forms[i].name == theFormName) {
theForm = document.forms[i];
continue;
}
}
var n=theForm.elements.length;
for (var i=0; i<n; i++) {
switch (theForm.elements[i].type) {
case 'select':
case 'select-one':
theForm.elements[i].onchange = function () { xhr.getPrice(); }
break;
case 'text':
theForm.elements[i].onkeyup = function () { xhr.getPrice(); }
break;
case 'checkbox':
case 'radio':
theForm.elements[i].onclick = function () { xhr.getPrice(); }
break;
}
}
xhr.getPrice();
}
<?php
// the following statements should allow multiple onload handlers to be applied
// I know this type of event registration is technically deprecated but I decided to use it because I haven't before
// There shouldn't be any fallout from the downsides of this method as only a single function is registered (and in the bubbling phase of each model)
// For backwards compatibility I've included the traditional DOM registration method ?>
try { // the IE event registration model
window.attachEvent('onload', init);
} catch (e) { // W3C event registration model
window.addEventListener('load', init, false);
} finally {
window.onload = init;
}
// Endy hidey ]]></script><?php } ?>
##########___Code for attributes replace main image
<!-- ATTRIBUTE IMAGE REPLACE MAIN IMAGE-->
<script language="javascript" type="text/javascript">
function changebgcolor(id,color) {
document.getElementById(id).style.backgroundColor=color;
}
function changevalue(field,color)
{
for(var i=0;i<document.cart_quantity.elements.length;i++)
{
if(document.cart_quantity.elements[i].name==field)
{
document.cart_quantity.elements[i].value=color;
}
}
}
var xmlHttp
function getattribimage(attribfield,width,height,products_options_values_id,products_id)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="attrib_prod_info.php";
url=url+"?width="+width+"&height="+height+"&products_options_values_id="+product s_options_values_id+"&products_id="+products_id;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4)
{
var product_color_image=xmlHttp.responseText;
if(product_color_image!=''){
document.getElementById('productMainImage').innerHTML = product_color_image;
}
}
}
//--------------------------------------------------------
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
</script>
-
Re: Dynamic Price Updater
Hi Dan or anybody that can help ...
Simple question with a simple answer I hope ..
http://www.prestigeringcompany.com/i...products_id=56
The price i.e: Your Price: £110.00, appears twice on the page. I only want the second/lower price to appear. How would I go about this?
Many thanks in advance.
Steve
-
Re: Dynamic Price Updater
Hi all
I know I've been highly delinquent in my support of the Updater... For this I apologise; I've some serious employment issues and have hardly any time
Now, I know I've said this before but I am going to fix the Ajax issue (browsers permitting of course)
121: Your issue can be fixed by adjusting the line
Code:
var _secondPrice = 'cartAdd';
to
Code:
var _secondPrice = false;
HTH
Again, sorry everyone... I'll get back to work on this at my earliest opportunity
Dan
-
Re: Dynamic Price Updater
Can anyone suggest how to remove or hide the '(+$85.00)' from the attribute dropdown. With the dynamic updater, displaying this is kind of irrelevent as the price changed when the attribute is selected. It would make for a much cleaner display if this price increase did not display. Removing it from the modules/attributes.php causes problems with the updater though, so if anyone could make any suggestions, that would be appreciated.
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
exoticcorpse
Can anyone suggest how to remove or hide the '(+$85.00)' from the attribute dropdown. With the dynamic updater, displaying this is kind of irrelevent as the price changed when the attribute is selected. It would make for a much cleaner display if this price increase did not display. Removing it from the modules/attributes.php causes problems with the updater though, so if anyone could make any suggestions, that would be appreciated.
This post explains how:
http://www.zen-cart.com/forum/showpo...02&postcount=9
Just remember to make a backup copy of your original file before making the modifications in case something goes wrong.
:smile:
-
Re: Dynamic Price Updater
Hi All, Superb Addon, really a useful tool...
I found a small issue which I have worked around but thought I would post.
If you have the 'checkbox' attributes option, if you select two, it will not add the base price and only the(+ given_value) to the one already selected.
So if I'm selling size 1 for $20, size 2 is +$20 and size 3 is +40
If I were to sect options 2 AND 3 the price would be $80 and not $100 as it should be as on the 2nd option it misses the base price. I hope this makes sense...
Using radio buttons prevents this happening. No big deal, just thought I would bring it up.
Also - Where can I rename the 'Your Price' do I have to add a comment in order to do this as it seems to be auto generated in the jscript_ajax_update.php file???
One final thing, can I remove the brackets and (1) after Your Price as it will only ever be showing 1 on my site and its a bit pointless for my particular needs?
Thanks
Steve
-
Re: Dynamic Price Updater
Great mod. I have been using it with great success . Recently client notified me that the prices showing in the list view does not reflect the prices set by the attributes. Prices in the list view (basically the index page) are listing old prices prior to installation of 'Dynamic Price Updater ' .
How would I go about fixing that. My version of of Dynamic Price Updater was installed around August version v2.03
Thanks
-
Re: Dynamic Price Updater
Ok still no answer? Well since I have installed the newest version of Price Updater and still no change. I even went to phpAdmin and replaced those incorrect amounts in the list view manually and still displaying incorrect old amounts. Yes I have edited the one and only database. Please see attached images in sequence . You will see that list view amounts are different then attribute amounts.
I really need to sort this out and any help or suggestion would be a great help.
Thank you
-
Re: Dynamic Price Updater
Hi
I saw in your posts that this mod works with radio and drop down attributes types.
Is this possible to use it with Product Attribute Grid?
Thank you.
-
Re: Dynamic Price Updater
Hi Guys,
I have been through this thread and couldn’t find any more info, this is an excellent add-on and I always use it. For my new site I have run into a problem.
I have commented out two lines in attributes.php that removes the prices from the dropdowns so just the different option name and not the prices are seen.
$products_options_display_price= ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] .
$currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ATTRIBUTES_PRICE_DELIMITER_SUFFIX;
Problem is it stops the DPU working.
I have spent a bit of time trying to figure out how to get them both working together and I have drawn a blank. Has anyone figured out how to get this working for 1.38a as the solution earlier in this thread doesn’t work for me as its for 1.37, any changes that I make just blanks the page.
Is it possible to change the output to either a specific color, or not visible so the DPU can still work but the price can’t be seen?
Can anyone help, my page is just standard
http://tinyurl.com/ylzxdol
Any help would be greatly appreciated.
Thanks
Chingy
-
Re: Dynamic Price Updater
Are you still developing this chrome.
I really need to get this to work with 'attribute replaces main image' mod
Any help at all would be appreciated. Has anyone else conquered compatibility problems...also £50 via PayPal still stands for anyone who can help.
-
Re: Dynamic Price Updater
Does anyone have any idea how to get the prices removed from the dropdown? I have done it on the older version of dynamic updater but no matter what code I try it won't work on the latest version....I tried adding a span so I can at least make the price text white so it is invisible that did not work either!
Does anyone have and answer who can help? I have tried everything!
Thanks!!!!
-
Re: Dynamic Price Updater
I have installed it like in the instructions (Version2) both my test site and live site and nothing is showing..
Have i missed something, or something i need to 'turn on' ?
Cheers
Grant.
-
Re: Dynamic Price Updater
does this contribution not have any support anymore!!
-
Re: Dynamic Price Updater
does this contribution not have any support anymore!! :cry:
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
Chrome
Hi all
I know I've been highly delinquent in my support of the Updater... For this I apologise; I've some serious employment issues and have hardly any time
Now, I know I've said this before but I am going to fix the Ajax issue (browsers permitting of course)
121: Your issue can be fixed by adjusting the line
Code:
var _secondPrice = 'cartAdd';
to
Code:
var _secondPrice = false;
HTH
Again, sorry everyone... I'll get back to work on this at my earliest opportunity
Dan
Their still is support you just have to read a few post back sometimes.
-
Re: Dynamic Price Updater
Hi all
I sincerely apologise for my lack of support
I've been suffering some health issues... This is the first time I've checked the thread in a while... Sorry
As soon as I can over the next week or so I'll get some fixes written and re-scan the thread for issues
Please bear with me
Dan
-
Re: Dynamic Price Updater
Get well soon chrome :smile:
Please can someone help me with this little problem. I don't know PHP very well at all but I've tried my best.
I'm using DPUv2 which is working great BTW! The problem is I have replaced the code from "<!--bof Add to Cart Box -->" to "<!--eof Add to Cart Box -->" in my "tpl_product_info_display.php" with this code that I got from another thread:
Code:
<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
// do nothing
} else {
?>
<?php
$display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
// hide the quantity box and default to 1
$the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
} else {
// show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
$display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
?>
<?php if ($display_qty != '' or $display_button != '') { ?>
<?php
echo $display_qty;
?>
<div id="cartAdd" style="display:none;"> Wait ..... images are uploading ......<br>
This can take several minutes .... Please wait ...<br> <img border="0" src="/includes/templates/pc020/images/progress.gif" width="350" height="50"> </div><a href="javascript:ShowDiv()"></a> <div onclick="ShowDiv()">
<center><br>
<?
if ($pr_attr->fields['total'] > 0 && (!$_SESSION['customer_id'])) {
echo '<a href=index.php?main_page=login><b><font size="3" color="red">IMPORTANT:<br>You have to login before order this item<br>
--- Log in here ---</a></font></b>';
} else {
echo $display_button;
}
?>
</div>
</div>
<script language="javascript">
function ShowDiv()
{
document.getElementById("cartAdd").style.display = '';
}
</script>
<?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box-->
What it does is hides the add to cart function until the user logs in. I want this in order to prevent the user uploading files without logging in.
The problem, this has caused with DPU is that the price is displayed as 0 until the user logs in. I would like the user to be able to see the prices whether logged in or not.
I'm not very good at PHP but have played around to try and get the price to display with no luck. Does anyone have any idea if I could make this work.
Any help very much appreciated!!!
-
Re: Dynamic Price Updater
Hi all,
just a question, do someone menage DPU to work with Dual pricing mod?
The thing i'm looking for is the showing of the two different prices in the product_info page.
With Dual pricing if you are logged and you are a wholesaler you will see 2 prices Retail and Wholesale.
After installing DPU when you load the product page the prices will show for a sec and after the "Wholesale price" and "retail price" will disappear leaving only "price" which will show the correct price by the way. It should be a java issue maybe, if someone solved it please just tell me how :-)
-
Re: Dynamic Price Updater
Hi all
gl3ny: Sorry, the Updater uses the cart to derive its prices. If the cart says that someone has to be logged in then I'm afraid it has to be so
izar74: Again, sorry, at the minute at least the Updater doesn't support dual-pricing
These are all things that are on the backburner as I tackle some issues with other parts of the mod
Apologies for the huge delays involved here; it just seems to be the way my life is going currently :laugh:
Dan
-
Re: Dynamic Price Updater
For Products with Specials/Sales I cheated ... :cool:
I have the normal price display also shown when there is a special or sale ... and then I have the 2 magic prices that work based on the quantity ...
-
Re: Dynamic Price Updater
Can this module be applied to certain categories only? I have wholesale and retail pricing but store owner does not want the retail price of a certain category not show up. When I removed the retail price, the dynamic Price Updater stopped working in this area due to the item store owner not wanting to show is the lowest price of the sizes offered.
Is there a work around for this to show the next price in line?
BTW...I love this module, looks great on sites.
Thanks!
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
Ajeh
For Products with Specials/Sales I cheated ... :cool:
I have the normal price display also shown when there is a special or sale ... and then I have the 2 magic prices that work based on the quantity ...
How did you go around this linda? I know on the category page it would display the slashed out pricingas well but once you go into the detailed page the DPU goes to work. I was thinking about hardcoding the reg price with a slash out but if you have a cheat....hook me up! :D
also off topic here would you please take a look at this
http://www.zen-cart.com/forum/showth...726#post824726
thanks !!!!
-
Re: Dynamic Price Updater
The display is manage by the class in the template ... so I made the one at the top use a different class so the price did not change and put one at the bottom where the add to cart quantity is put in that had the class that gets changed ...
This way, the original price always shows on the page and the changing price of what the "actual" price will be based on quantity etc. would show right where the customer is working down by the attributes and add to cart quantity box ...
-
Re: Dynamic Price Updater
Hi all,
Im still struggling on removing the ( X ) at the end of the price:
http://www.realfairtrade.com/set-of-...lates-490.html
Where 'Your Price' is and the price Im fine with but those brackets look unprofessional. Does anyone else have this issue, or has someone solved it?
Thanks
Steve
-
Re: Dynamic Price Updater
Hi stiggy
If you open up dpu_ajax.php in an editor you should see this line:
Code:
define('DPU_SHOW_QUANTITY', true);
Change this to
Code:
define('DPU_SHOW_QUANTITY', false);
That should sort your problem :smile:
Dan
-
Re: Dynamic Price Updater
Hey Dan, did you ever get an update out to fix the mod. Still dont work for me.
-
Re: Dynamic Price Updater
Thanks Dan,
Top work, I was looking in the right file (as it could have only been that one!) but to no avail.
Appreciate it...
Steve
-
Re: Dynamic Price Updater
Hi,
First of all, thanks so much for this contribution.
- My "Your Price: $XX.XX (X)" message shows twice, how can I fix that?
- Would there be a way to show the quantiy update (X) only if the customer enters two or more on the add to cart qty box?
Thanks
-
Re: Dynamic Price Updater
I am very interested in using this contribution. However, I noticed your site is down. Is there an alternative location to download this file? Or do you mind PMing it to me. Thanks for the great work!
-
Re: Dynamic Price Updater
Hi
Crikey, I'd forgotten my site was down... I'll try my best to get it back up and running tonight (it's been moved to a new server)
Dan
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
christianpatrick
I am very interested in using this contribution. However, I noticed your site is down. Is there an alternative location to download this file? Or do you mind PMing it to me. Thanks for the great work!
Quote:
Originally Posted by
Chrome
Hi
Crikey, I'd forgotten my site was down... I'll try my best to get it back up and running tonight (it's been moved to a new server)
Dan
Addons supported on the Zen Cart site are supposed to be uploaded to the Free Addons area so these kinds of problems don't happen.
-
Re: Dynamic Price Updater
Hi
Site is back online... The mixture of DB engines can make it tricky to migrate :smile:
DrByte: I do recall offering the Updater for the official downloads section but being told that the bugs should be worked out first... Perfectly reasonable... Except that V1 was [unfortunately] riddled with bugs and a few remain in V2 (extended apologies) so I never reapplied to the section
In fairness my site has been down only twice since the Updater was released (around 3 and a half years ago) and I'm sure my excellent admin has the server in close quarters now :smile:
Aplogies for the inconvenience
Cheers
Dan
-
Re: Dynamic Price Updater
Hi Dan.
Exceptional work you are doing!. Thanks for your pitbull attitude to getting this just right. This is all new stuff for me, so please excuse my "techie" ignorance!. I installed the DPU 2.0a version yesterday. Works just fine!.
Except for a small problem, on those items I have as "Specials". The "original price, special price, and you save percent off" is replaced with the "Your Price" (DPU price) on the page.
I don't mind the DPU "Your Price" showing in the bottom instance, but I would like to keep the first instance of it at the top as "Original price, special price, with the Percent saved" intact, under the title. Can you tell me what I need to do. Thanks so much! You really are a tremendous asset to zencart.
You can see a test here:
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
Ajeh
The display is manage by the class in the template ... so I made the one at the top use a different class so the price did not change and put one at the bottom where the add to cart quantity is put in that had the class that gets changed ...
This way, the original price always shows on the page and the changing price of what the "actual" price will be based on quantity etc. would show right where the customer is working down by the attributes and add to cart quantity box ...
Linda.
Please put yourself in a newbies shoes (we all begin this way!). You have generally explained the way I want my product page displayed, BUT, Your instructions are still confusing to me.
1) "The display is managed by the class in the template."
Which template are you talking about, where do i locate it?
2) "So I made the one at the top use a different class."
Specifically what did you change and to what??
3) "and put one at the bottom where the add to cart quanitity is put etc"
I would really appreciate it if you would explain more clearly.
Thank you
-
Re: Dynamic Price Updater
Find the Price Block delimited with:
Quote:
<!--bof Product Price block -->
stuff here
<!--eof Product Price block -->
Copy it and change the class that it uses so that one uses the original class that is used with the Price Updater and another one so that it doesn't use it ...
What you get is two price displays ... one that reacts to the Price Updater and one that does not and shows the regular Price display ...
Once you have the two working correctly you can adjust where the prices display ...
-
Re: Dynamic Price Updater
Quote:
Originally Posted by
Ajeh
Find the Price Block delimited with:
Copy it and change the class that it uses so that one uses the original class that is used with the Price Updater and another one so that it doesn't use it ...
What you get is two price displays ... one that reacts to the Price Updater and one that does not and shows the regular Price display ...
Once you have the two working correctly you can adjust where the prices display ...
Thanks Linda. That made sense!:clap:
-
Re: Dynamic Price Updater
Glad that this could help you out thanks for letting us know ... :smile:
-
Re: Dynamic Price Updater
Hi all
I've been doing a bit of updating and housekeeping with the Updater... Firstly there was a bit of a discrepancy with the way the Updater was interacting with the cart which has now been fixed... As far as I'm aware there haven't been any situations where the bug might surface but it's better safe than sorry :smile:
Secondly, I've added the functionality for the Updater to display the weight of the product dynamically... I'm not sure if this is of any use to anyone but I thought I'd put it in there anyway... If you want to use it simply create a DIV or a SPAN with the ID of 'productWeight' and the Updater will update it for you automatically... I'd suggest something like the following layout:
Code:
<div class="myContainer">
Product weight:
<span id="productWeight"></span>
</div>
This code should go in includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php
I've also added a rudimentary sidebox feature but it's a bit more involved to get working... It's designed to work the same way as the one that was included with DPUv1 but I haven't quite got the prices for the individual attributes sorted out yet... Anyone that wants to give it a try (it isn't *very* difficult) should have a quick look at the readme included (under Update!)
I know this hasn't addressed any core issues that people have been experiencing but to be honest I've kind've lost track of all the issues... Could anyone still having a problem please repost it?
If there are any problems with the new additions please let me know
Cheers!
Dan
-
Re: Dynamic Price Updater
Hi all
After some messing about I've managed to get the attribute prices working in the sidebox and there's sort of a very basic templating system for the sidebox content
Go here for a demo http://chrome.me.uk/shopdev/
Anyway, if you're interested please give it a go and let me know how you get on :smile:
Cheers!
Dan
-
Re: Dynamic Price Updater
Sounds like you might have made some changes that might make the DPU work on our site now. Im going to re-download the new package and try updating my installation. Maybe it will work this time!
-
Re: Dynamic Price Updater
Fingers crossed and good luck :smile:
-
Re: Dynamic Price Updater
re-uploaded the files but it still appears to not work.
-
Re: Dynamic Price Updater
-
Re: Dynamic Price Updater
we are paying Jeff from Numinix to help us but the site is http://www. ribbonsbaskets. com
-
Re: Dynamic Price Updater
Hi
Bit of an odd one that... The Updater is definitely returning the values as I'd expect to see but the display isn't updating... Ive checked the element IDs and they seem to tally also... Really I'd have to be able to test on your site to be able to track this one down
As you already have someone helping you I'll bid you good luck :smile:
Give me a shout if I can help
Dan
-
Re: Dynamic Price Updater
If you could help with the problem it would be greatly appreciated. There are JS errors when the attributes are changed on the page if that helps.
-
Re: Dynamic Price Updater
Hi
I've checked out a few pages and the only JS error that I see is Now that's nothing to do with the Updater... If you have Firebug (for Firefox) you can see the XMLHTTP requests and responses happening with no problems... If there is a specific page that is causing errors PM me a link to it
It looks like the Updater is having difficulty getting a handle on the H2 that contains your price... If you want you can send me your FTP details (it may be preferrable to set up a temporary account) and I will take a look
Cheers
Dan
-
Re: Dynamic Price Updater
Your right the JS error was caused by something else. I took care of that.
-
Re: Dynamic Price Updater
Unfortunately I can't help any further without being able to run some tests local to your server... Unless you want to send me a TAR of the site (with the configuration.php trimmed to remove sensitive data) and the DB so I can take a look on my dev site
Dan
-
Re: Dynamic Price Updater
Could it be as simple as div nesting or css problems?
-
Re: Dynamic Price Updater
Seems like it would be a lot of work to send that to you although would not have a problem with it. If I cant figure it out though I suspect that I will probably do that.
-
Re: Dynamic Price Updater
Shouldn't be a CSS issue... The only thing that could really affect like this is if the ID was duplicated or the DOM was totally trashed... That doesn't appear to be the case
It's a headscratcher to be sure... I really can't see anything else from here
Dan
PS The FTP details are just a username and password... For the trouble you're having it seems a minor detour
-
Re: Dynamic Price Updater
Hi ksookma
Sorry for missing your email
The problem with your site is that line-breaks and/or whitespace is being inserted into your code... It can be seen in the source before the DOCTYPE declaration... It doesn't affect browsers too much but JS is very sensitive and the whitespace is causing the code to interpret the response as text (the header has to be the first thing interpreted, the same way as setting a cookie from the server)
I can't find anywhere this whitespace is output... It's very odd but if you check the source for your site there seem to a lot of line-breaks
Maybe a word with your server admin may help... I've seen this before but I can't remember what the solution was
Dan
-
Re: Dynamic Price Updater
By line breaks you mean <br> right. I have put in a lot of breaks to fix design issues. Should I remove all the breaks?
-
Re: Dynamic Price Updater
Hi
No... That's an HTML line break and is interpreted essentially as text... No it's \n (on Unix) linebreaks being output before the HTML even has a chance to get started
I've managed to narrow it down to something that includes/application_top.php is autoloading. Usually it's the product of a PHP tag being closed and a space or carriage return being present after the tag. Example:
Code:
// End of my code
?>
Note the extra line after the ?> ? That can cause a lot of problems with headers... Under normal circumstances this can be fixed by wrapping all of the code in an output buffer... Unfortunately, I can't get this solution to work on your site (I don't think Ajax calls can be buffered but I'm not certain)
The current solution? Trawl through all of the autoloaded/included files from application_top.php looking for the offender(s)... Boring and lengthy job I'm afraid
Dan
-
Re: Dynamic Price Updater
I know you have been on and of the site for a long while looking at this problem for us. I made a donation through your site link. Im so glad it works, thank you!:D
We will be using your services in the future!
-
Re: Dynamic Price Updater
Hi
Thanks for the donation... As always it's greatly appreciated :smile: (though never required)
The solution I discovered for you was fairly unique I think
I'm glad your site is working now :smile:
Dan
-
Re: Dynamic Price Updater
Hi all
I've set up a new site for testing... Anyone that wants to see the new Updater working can go to http://chrome.me.uk/shopdev2/ for a look :smile:
Thanks to Ajeh for letting me know that the original test site was hacked
Dan
-
Re: Dynamic Price Updater
Hi Chrome,
Glad to see that you are much better and solving problems, life in the valleys is returning to normal.
I posted went you weren’t to good an think that you may have missed this, do you have a idea how to go about sorting this:-
I have been through this thread and couldn’t find any more info, this is an excellent add-on and I always use it. For my new site I have run into a problem.
I have commented out two lines in attributes.php that removes the prices from the dropdowns so just the different option name and not the prices are seen.
$products_options_display_price= ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] .
$currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ATTRIBUTES_PRICE_DELIMITER_SUFFIX;
Problem is it stops the DPU working.
I have spent a bit of time trying to figure out how to get them both working together and I have drawn a blank. Has anyone figured out how to get this working for 1.38a as the solution earlier in this thread doesn’t work for me as its for 1.37, any changes that I make just blanks the page.
Is it possible to change the output to either a specific color, or not visible so the DPU can still work but the price can’t be seen?
Any help would be greatly appreciated.
Thanks
Chingy
-
Re: Dynamic Price Updater
Hi
Thanks!
It sounds like you're using V1 of the Updater... Have you tried V2? It doesn't rely on the display to calculate the new prices
Let me know
Cheers
Dan
-
Re: Dynamic Price Updater
Hi all
I've made another slight addition to the Updater... I noticed before that some sites can get slow at certain times of the day and it can sometimes seem as if the Updater isn't doing anything so I've added a little loading graphic to show that something is still happening
The graphic appears next to the main price and in the sidebox... For a working demo go to http://chrome.me.uk/shopdev2/ ... I've deliberately slowed the script down on the server to mimic a slow site
Cheers
Dan
-
Re: Dynamic Price Updater
Hey Chrome,
Nice! How can we add this to our DPU files? Will we need to over ride anything?
Pkat
-
Re: Dynamic Price Updater
Hi
I'd recommend re-uploading the whole package... It's just a case of letting your FTP client overwrite the existing files :smile:
Dan
-
Re: Dynamic Price Updater
-
Re: Dynamic Price Updater
hey dan, just wanted to thank you for the DPU and WELCOME BACK! :clap:
-
Re: Dynamic Price Updater
Hi
Thanks!
I'm looking for some ideas for features to add to the Updater so if anyone has any suggestions please post them here :smile:
I'm already looking into having the updater work on the category pages but that looks to be a release for some time in the future
Cheers
Dan