Re: Price Updater - plugin keeps disabling
Apologies for the late notification.
Last weekend, I uploaded an updated copy of DPU for review; however, in true fashion shortly after doing so I discovered a couple of issues when I attempted to use the features from a specific mobile device which ultimately was a result of using a default value in a parameter within the javascript code. By review of javascript discussions, this shouldn't have been a problem, but it would seem that the particular device wasn't playing by "today's" standards, so a resolution to that has been created. Also, in rewriting a portion of the dpu class code, I had not taken into account changes that would be needed for the provided/included sidebox. Also, the newly included installer includes a check for updated versions; however, it also expects the ability to disable version checking which was not included in the installer sql.
Anyways, all of that said, I am working on the instruction to address the updates/modifications most of which are available currently from github: https://github.com/mc12345678/Dynamic_Price_Updater
So stay tuned for version 3.0.6, I would like to have it pushed to the forum for review over the weekend, other projects pending.
Quote:
Version 3.0.5:
- Improved installation/installer
- Previous process for installation included a delete of previous settings. This is now performed using insert ignore style sql and as necessary to update settings with a focus of configuration sort order.
- Rewrote the data collection about a product to improve ability to compare to the active cart.
- If using the class function of insertProducts, the resulting prid is an integer only and does not include the possibility of addressing attributes based on the change(s) made here. This is equivalent to a standard product being listed in the product listing screen being added to the cart where attributes are "typically" not selectable.
- Modified quantity reporting to provide quantity already in cart for selected attributes if the quantity is greater than zero.
- Incorporated forum correction for operation when DPU_SHOW_LOADING_IMAGE is set to false.
- Added JSON response information when retrieving results.
- Incorporated the use of Zen Cart's provided zcJS when it is available.
- Made the DPU class part of the overall system to better support additional observers as needed.
- Maintained the "default" XML response if JSON is not requested to align with potential historical alterations.
- Added the restoration of the price display if the transaction fails.
- Added jscript function to perform data/screen update/swap.
Available here.
Re: Price Updater - plugin keeps disabling
Submitted v3.0.6, awaiting review. When posted should be available from here: https://www.zen-cart.com/downloads.php?do=file&id=1301
Description provided:
Quote:
3.0.6:
- Modified/updated the class information to provide the sidebox data.
- Correct additional javascript errors to prevent having to catch them.
- Modified sidebox to not display/be active if the page's javascript for dpu is not active.
- Added additional type casting to force data to the expected type.
- Incorporate the tax calculation correction posted in the forum into the code.
- Removed the use of default parameters because some browsers do/did not support it.
- Add separate control for update checking of this plugin.
- Updated installer version check to ZC 1.5.5e version.
- Corrected installer code to validate new version exists.
Anyone that has fully installed version 3.0.5 should be notified through their admin when version 3.0.6 is made available for download.
Re: Price Updater - plugin keeps disabling
Quote:
Originally Posted by
mc12345678
Submitted v3.0.6, awaiting review. When posted should be available from here:
https://www.zen-cart.com/downloads.php?do=file&id=1301
Description provided:
Anyone that has fully installed version 3.0.5 should be notified through their admin when version 3.0.6 is made available for download.
Version 3.0.6 has been posted for download; however, there were a few additional things discovered that are addressed in version 3.0.7 (also on github):
Quote:
3.0.7, What changed:
- Corrected issue that price of product without attributes was not incorporated/considered because
the dpu javascript code basically prevented overwriting the price until corrections were made
in version 3.0.6 that would automatically rewrite the current price display based on what
dpu determined based on the product. (This additional feature was added to support display of
the appropriate information when returning to the product from the shopping cart.)
- Because the price is automatically calculated based on arriving at a product, if a product is
priced by attributes and not all of the "mandatory" attributes are selected then the price
was only showing the price point of those that were selected. The code now calculates the
lowest available price based on the selections already made. The displayed text has not been
edited to account for this "feature" yet, but could be modified to support the condition.
Only the dpu class file was modified in version 3.0.7 as compared to 3.0.6 and the addition of the installer "version" file.
When the software review team has made it through the review and posting of the update it should be available here: https://www.zen-cart.com/downloads.php?do=file&id=1301
Welcome further feedback/suggestions of how these additional features/calculations are presented. See at least one place where an additional notifier could maybe add some functionality to the code.
Re: Price Updater - plugin keeps disabling
Good morning at all, I can not change the decimals ie I would like the decimal ones to be a spin instead of a point, and miles a point instead of a comma.
In the currency the comma is set to the decimal then it is not zen cart the problem but dpu. Thank you for the reply.
Ps
I installed version 3.07
Re: Price Updater - plugin keeps disabling
Quote:
Originally Posted by
diamond1
Good morning at all, I can not change the decimals ie I would like the decimal ones to be a spin instead of a point, and miles a point instead of a comma.
In the currency the comma is set to the decimal then it is not zen cart the problem but dpu. Thank you for the reply.
Ps
I installed version 3.07
What is your setting for: Show currency symbols?
If it is true, then all currency related values should be reflected when displaying a price (i.e. a number such as 3000 with a fraction of 1/2 would be displayed as 3.000,5 when using a decimal for the thousands place and a comma (spin) for the part of a number, or if a comma (spin) for the thousands place and a period for the part of a whole it would be 3,000.5).
As to other "units" such as miles/km, DPU should return whatever has been entered. If there is some other "special" conversion to be performed based on what attribute is being addressed then this conversion/handling would need to be incorporated into the includes/classes/dynamic_price_updater.php file. To address this in the sidebox (only place that updates with a specific attribute's option "name" or value "name"), then would suggest that if modifying the displayed attribute that it be handled in the function getSideboxContent with further suggestion of addressing in this "area"
Code:
if (is_array($this->shoppingCart->contents[$products[$i]['id']]['attributes'])) {
// while (isset($this->shoppingCart->contents[$_POST['products_id']]['attributes']) && list($option, $value) = each($this->shoppingCart->contents[$_POST['products_id']]['attributes'])) {
foreach ($this->shoppingCart->contents[$products[$i]['id']]['attributes'] as $option => $value) {
$adjust_downloads ++;
$attribute_price = $db->Execute("SELECT *
FROM " . TABLE_PRODUCTS_ATTRIBUTES . "
WHERE products_id = '" . (int)$prid . "'
AND options_id = '" . (int)$option . "'
AND options_values_id = '" . (int)$value . "'");
$data = $db->Execute("SELECT products_options_values_name
FROM " . TABLE_PRODUCTS_OPTIONS_VALUES . "
WHERE products_options_values_id = " . (int)$value);
$name = $data->fields['products_options_values_name'];
At/after this last line ($name = ...) would evaluate the options_id ($option) and options_values_id ($value) to see if either/both should be the one(s) to be manipulated to display an alternate series of comma (spin) and period... Ie. if the option name is miles and has an option_id of 27 and all available option values are numbers, then:
Code:
if ((int)$option == 27) {
$name = /* function or code to convert the previous value of $name to use the new units */;
}
Otherwise I am not sure what you mean by the usage of miles in this context because the values presented/calculated by DPU are the cost factors and not some "unit". Such "comparison" or use of units would be or have been a modification to the core coding of ZC.
I guess it could also be possible that a "cost" could be displayed with specific units/decimals by use of the php function number_format described in the php manual here as applicable.
But would need more information to provide further guidance/assistance.
Re: Price Updater - plugin keeps disabling
Titre : Euro
Code: EUR
Symbole à gauche :
Symbole à droite : €
Point décimal : ,
Séparateur des milliers : .
Nombre de décimales : 2
It's all set up as it should, without DPU everything works the prices are 3.000,50 €
With DPU the price becomes 3,000.50
Re: Price Updater - plugin keeps disabling
Quote:
Originally Posted by
diamond1
Titre : Euro
Code: EUR
Symbole à gauche :
Symbole à droite : €
Point décimal : ,
Séparateur des milliers : .
Nombre de décimales : 2
It's all set up as it should, without DPU everything works the prices are 3.000,50 €
With DPU the price becomes 3,000.50
Sorry, I should have been clearer:
What is your setting for: Show currency symbols?
As found on the admin->configuration->Dynamic Price Updater window.
Based on your report it sounds like it is set to false and should be set to true.
Re: Price Updater - plugin keeps disabling
Thanks you were right I have to enable the currency to change the comma to point, although it does not make sense but you helped me solve this thanks again
Re: Price Updater - plugin keeps disabling
Quote:
Originally Posted by
diamond1
Thanks you were right I have to enable the currency to change the comma to point, although it does not make sense but you helped me solve this thanks again
I was also wondering why the code had an option to return the value without using currency symbols but then realized that the javascript that processes the response can be altered and it may be that one needs to not have currency symbols and that they would add them in.
Anyways, glad that the issue is resolved.
Re: Price Updater - plugin keeps disabling
If i would like to modify it by javascript what would be the change and where?