Hey mc12345678,
I tried the latest fork from github: https://github.com/mc12345678/Dynami...debox-possibly
However, the price always shows as $0... Using ZC 1.5.5a - will this work, or is there something extra I need to do?
Thanks,
Chris
Printable View
Hey mc12345678,
I tried the latest fork from github: https://github.com/mc12345678/Dynami...debox-possibly
However, the price always shows as $0... Using ZC 1.5.5a - will this work, or is there something extra I need to do?
Thanks,
Chris
Here is an example page:
https://tacunasystems.com/zc/index.p...roducts_id=271
However, I've disabled the plugin as the site is live. Maybe I could PM you and enable the plugin so you can see it?
Thanks so much!
Chris
Well, a smidge of a template issue...
See part of calculating the total cost is to include the quantity of product to be added to the cart. In the case of your current template which is HTML5 styled, the cart_quantity field has been designated as an input type="number". This wasn't previously captured by DPU and therefore, the price would be $0.00 afterall, 0 * any number is well 0. :) I've updated my github distribution to incorporate the input type="number" and it is working on my "test" site, but there may still be some other issue involved after you get the file(s) updated. Effectively you have sort of two dropdowns. One which is the ZC original version, the other is this I guess javascript based (I didn't look far into it yet, because of the other issue needing to be addressed first). It looks like the two operate independently and well after making some modifications to make the original ZC version visible which I believe because it was hidden doesn't have the appropriate events tied to it that neither is really being listened to for the price update, so there is that little bit to overcome... But at least the price wouldn't show as 0.
Again, the way I see it, and if you do still have your "version" from 1.5.1 and you were using this current template, there may still be some value to holding onto the older one and just having to update a few things to further the functionality within the latest ZC...
Ah I see. I updated it and it almost works properly. The price displays but will only update after you fiddle with the quantity. ie. I can select an attribute with +$100, but the price won't change. After I increase the quantity to 2 and back down to 1, the price is correct given the chosen attribute.
I'm curious to know if anyone else is experiencing the same problems I am.
zc 1.5.5
dpu 3.0.3
MyDEBUG files show:
[27-Mar-2017 13:11:07 America/Denver]
PHP Warning: reset() expects parameter 1 to be array, null given in /includes/classes/dynamic_price_updater.php on line 175
[27-Mar-2017 13:11:07 America/Denver]
PHP Warning: Variable passed to each() is not an array or object in /includes/classes/dynamic_price_updater.php on line 176
Browser Developer Tool shows:
TypeError: objSB.appendChild is not a function
/includes/modules/pages/product_music_info/jscript_dynamic_price_updater.php #256
Code:function createSB()
{ // create the sidebox for the attributes info display
if (!(document.getElementById('dynamicpriceupdatersidebox')))
{
var tempC = document.createElement('div');
tempC.id = 'dynamicpriceupdatersideboxContent';
tempC.className = 'sideBoxContent';
tempC.innerHTML = 'If you can read this Chrome has broken something';
objSB.appendChild(tempC);
temp.parentNode.insertBefore(objSB, temp);
}
}
Page Bounce
selecting an attribute price causes the ajax-loader.gif to briefly appear forcing text down, then the ajax-loader.gif disappears and text bounces up
Can't speak for version number, but the first is a coding issue that I've worked on and believe I've resolved at least on my test site with code to be uploaded to github and then compared with the most recent ZC push to see how to move forward with the changes of that version. See the sidebox concept was partially incorporated into the code, then some of it was removed, some disabled, and there has been some further development to provide a real sidebox object instead of using javascript to create one, etc... anyways. That aside, if I remember correctly the sequencing of the javascript also was an issue which could lead to the reported problem. Javascript doesn't like to have to guess about an object that is defined after it is used. Big difference compared to how say php let's you used a function that is in a file but defined below the point of use.
The second issue, well there are a number of ways to prevent/address. One is to set aside css space at the location where the image will appear so that when it does appear, nothing else moves. Another is not to show the image when processing/waiting, yet another is to get a smaller image that also doesn't push content.
But it's not really a DPU "problem" per se in my opinion. There is no one size fits all "response" to the action.
Just submitted an updated version (3.0.4) of this plugin to address the following issues.
Will be available from here upon review and posting by a software moderator. Will post when discovered to be uploaded.Quote:
3.0.4 has a few bugfixes as well as general improvements for the overall operation.
- Added data sanitization to the database queries.
- Incorporated full database table names instead of providing some sort of prefix to the anticipated table name.
- Added ZC 1.5.5e ajax.php file for use to take the place of dpu_ajax.php
- Added zcDPU_Ajax class to support AJAX calls.
- Incorporated currency number formatting based on the currency selected in the session instead of with a hard value of 2.
- Converted code to be PHP 7.2 compliant regarding known deprecations.
- Split out the on_load code to its own file.
- Applied parenthesis around actions to be taken for if statements.
- Correct a potential javascript error if secondPrice isn't being used.
- Added ability for image to replace the text to be updated such that there is no line height adjustment.
- Remove the eval function and instead call the function dynamically that is expected.
- Converted single quotes to double quotes.
- Added evaluation of number style fields as an additional option.
- Made monitoring of entered data by event as an added event instead of a replacement event to improve Javascript interactions.
- Removed unnecessary underscore from variables.
- Added semi-colons to end of functions for appropriate Javascript syntax.
- Removed the code from dpu_ajax.php as the code is otherwise incorporated to use the ZC ajax.php file.
- Added tax for display of price with currency symbols.
- Replaced intval() with (int) casting.
- Copied changes from standard product_info to product_music_info.