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

Dynamic Price Updater

Views: 342,268

Results 1,421 to 1,440 of 1,701
5 Nov 2017, 8:13 PM
#1421
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Dynamic Price Updater

Lordzoabar:

That's fine. I compleatly understand stress from a thousand minor issues building up.

After finally figuring out that the write permissions for our Logs folders were turned off..... (I inherited the site maintainance from someone else, in order to clean up their mess...) This is what I've got.

[B] PHP Parse error: syntax error, unexpected '(float)' (double) (T_DOUBLE_CAST) in /home/athensar/public_html/includes/classes/dynamic_price_updater.php on line 200

Line 200 reads:

  $this->shoppingCart->contents[(int)$id] = array('qty' => (empty((float)$qty) || (float)$qty < 0 ? zen_get_buy_now_qty((int)$id) : (float)$qty)); //(float)$qty);
Good work sleuthing out the logs folder issue(s). Probably then also saw that that particular issue had been discussed with a solution provided. Since then (a couple of weeks ago) I've also added some features to the mix for an improved user experience.

Take a look at this comparison between version 3.0.8 and the current github software: <https://github.com/mc12345678/Dynamic_Price_Updater/compare/v3.0.8...master>

It contains a function that I plagiarized from a Pull Request pushed by DrByte for an upcoming ZC release (please follow the depth of that PR for proper credit recognition). 

Unfortunately in trying to enforce variable type and value, a little bit of a work around was needed to provide a single function that gives the needed data/value instead of a continued horrid amount of logic each time. :) 

Btw, it also was that I was aggrivated at myself that I couldn't better express what was needed so that you (and others) could get through this faster than slower. :)
5 Nov 2017, 8:48 PM
#1422
lordzoabar avatar

lordzoabar

New Zenner

Join Date:
Nov 2017
Location:
Athens, Georgia, USA
Posts:
104
Plugin Contributions:
0

Re: Dynamic Price Updater

SUCCESS!

If I am understanding what you said correctly, the module has issues when presented with a product that has multiple attributes? Our shop deals with custom framing and photo printing/restoration, so I'm assuming when it was requesting product size, paper type, glass type etc... everything else got overwhelmed which led to a full-on crash.

That it's finally working, especially with those stated options, this is an absolute godsend for us. :)

22 Nov 2017, 4:18 PM
#1423
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Dynamic Price Updater

Just posted Version 3.2.0 of DPU to be reviewed for issue.

Here is a summary of the changes made:

3.2.0, What changed:

  • Identified this version as 3.2.0 because 1) this update provided significant new functionality and modified/provided new database features and 2) 3.1.0 had previously been identified in the github path/history and did not want to cause undo confusion.
  • Commented out code that performed no operation/action.
  • Added an update to the customer's latest page when using an ajax style call to improve display of information on the who's online admin page.
  • Added a method to update price text to represent when none and less than all attributes have been selected.
  • Added DPU_ATTRIBUTES_MULTI_PRICE_TEXT to be able to control which of the pretext(s) to allow to show.
  • Added a variable to be able to update/display the text before the first price when price includes a special and/or a sale.
  • Added ability to update what is known as the normalprice which is the price/value that is crossed out when there is a sale or other special.
  • Added stock quantity update capability which incorporates the possibility of operating with ZC 1.5.x and control how the information is replaces other content. Guidance for display modifications provided in readme.txt.
  • Corrected use of float casting to use code published in ZC 1.5.6 to support strict server mode.
  • Reworked code to better account and control sub-functional area execution.
  • Removed single quotes from SQL queries that included casted integers to minimize further processing.
  • Expanded attribute text switching to more than product priced by attribute such that should apply to product that have attributes that affect the base price.
  • Corrected price display and determination to include pricing associated with text (word and/or letter pricing, etc...)
  • Updated javascript side to use exactly equal to instead of loosely comparing two values (in a majority of examples.
  • Switched javascript calls to use dot notation where able.
  • Added a fallback attempt for collecting/setting JSON response if responseJSON is empty but a non-fault responseText is provided.
  • Moved javascript variable declaration out of most function calls.
  • Corrected an issue reported by mvstudio of where the expected text to be in front of the priced item would not be displayed if the imgLoc variable in the includes/modules/pages/PRODUCT_TYPE/jscript_dynamic_price_updater.php file was not set to "replace". Essentially the result was that pspClass would be blank when sending to ajax.
  • Added change detection and capture of the html element textarea and changed the text detection to an input event instead of a keyup event. This allows capture/detection of pasted content without firing off multiple events for the same modification. Additional testing may reveal the need to incorporate other event listeners. The process would be similar as shown for the number case.
  • Updated ajax.php file to prevent known spiders from performing ajax requests. This is from the ZC 1.5.6 version of the file
  • Moved the status notification from an alert to a console log when zcJS is not used and a 200 status result is not received.

Once reviewed and accepted it will be available for download from this ZC download page.

It may also be obtained from this github tag.

8 Dec 2017, 9:06 PM
#1424
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Dynamic Price Updater

mc12345678:

Just posted Version 3.2.0 of DPU to be reviewed for issue.

Here is a summary of the changes made:

Once reviewed and accepted it will be available for download from this ZC download page.

It may also be obtained from this github tag.

Version 3.2.0 of Dynamic Price Updater has been posted to the download section and is available from here.

9 Dec 2017, 9:25 PM
#1425
lordzoabar avatar

lordzoabar

New Zenner

Join Date:
Nov 2017
Location:
Athens, Georgia, USA
Posts:
104
Plugin Contributions:
0

Re: Dynamic Price Updater

Updated and everything is (mostly) working perfectly. Dynamic Price Updater is doing everything it is supposed to be doing, except for any items I have that are marked as on sale. It still dynamically updates the price, both before and after the sale is effected, but it is causing a weird graphical glitch. I've included pictures of one of the product pages, both with and without DPU enabled.

Enable=FALSE
Attachment 17519

Enable=TRUE
Attachment 17520

I have Error Logging activated, but it isn't turning anything up, so I have no idea where to actually look.

https://www.athensartandframe.com/ is our live site, if you want to see what I'm talking about in action. It's pretty much every item that is marked as being on sale, which will be our Diploma and Business frames, and the framed artwork.

9 Dec 2017, 10:18 PM
#1426
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Dynamic Price Updater

Lordzoabar:

Updated and everything is (mostly) working perfectly. Dynamic Price Updater is doing everything it is supposed to be doing, except for any items I have that are marked as on sale. It still dynamically updates the price, both before and after the sale is effected, but it is causing a weird graphical glitch. I've included pictures of one of the product pages, both with and without DPU enabled.

Enable=FALSE
Attachment 17519

Enable=TRUE
Attachment 17520

I have Error Logging activated, but it isn't turning anything up, so I have no idea where to actually look.

https://www.athensartandframe.com/ is our live site, if you want to see what I'm talking about in action. It's pretty much every item that is marked as being on sale, which will be our Diploma and Business frames, and the framed artwork.
So, a portion of the issue was identified after posting the change to the ZC forum for review, another part though is new "territory" as I haven't seen the space that follows the Sale: turned into the html entity ```
 


The part that was identified was the reuse of the definition: PRODUCT_PRICE_SALE for the preDiscPrefix when displaying the product's "original" price as compared to its sale price.

If you take a look in: includes/classes/dynamic_price_updater.php
Within the function prepareOutput, you would see this code section related to the final display of a product that has a sale:

    case ($_POST['pspClass'] == "productSalePrice"):
        $this->prefix = PRODUCT_PRICE_SALE;
        $this->preDiscPrefix = PRODUCT_PRICE_SALE;
Basically you will want to provide different text (right side) for the last line of code provided above. This can be done by adding another language definition for the plugin such as UPDATER_PREFIX_SALE_DISCOUNT_TEXT, add the define to the language file, then replace the second use of the above PRODUCT_PRICE_SALE with the above UPDATER_PREFIX_SALE_DISCOUNT_TEXT and then should be fine. 

I wanted to provide such definitions for each entry, but the realized that searching for the text to change it would return many entries or I would have to put text in for all of them that was different and more than likely undesirable anyways. :) The third option which is needed regardless is to offer more instruction about how to use/modify the results to get something more desirable.

For comparison of what the store did as compared to what it will, looks like you will want a prefix for the pre-discount price of empty single quotes: ''. 

So, in: includes/languages/english/extra_definitions/dynamic_price_updater.php

Add:

define('UPDATER_PREFIX_SALE_DISCOUNT_TEXT', '');


Then in the class file at line 116, change:
       $this->preDiscPrefix = PRODUCT_PRICE_SALE;
To:
       $this->preDiscPrefix = UPDATER_PREFIX_SALE_DISCOUNT_TEXT;

That should resolve your situation for sale product.
9 Dec 2017, 10:57 PM
#1427
lordzoabar avatar

lordzoabar

New Zenner

Join Date:
Nov 2017
Location:
Athens, Georgia, USA
Posts:
104
Plugin Contributions:
0

Re: Dynamic Price Updater

That ended up working perfectly, except I have another issue, which I honestly thought this would have fixed as well, but IDK...

Enable=FALSE
Attachment 17521

Enable=TRUE
Attachment 17522

I'm assuming this is from the same Class file, but I didnt see anything that would create that "Your Price" thing.

https://www.athensartandframe.com/index.php?main_page=index&cPath=73 It's only our First Dollar frames that really show this issue. All of the frames in other subcategories have "Starting at" show up at first, but after a second, and the updater fully loads, it disappears and everything works as it should.

10 Dec 2017, 1:14 AM
#1428
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Dynamic Price Updater

Lordzoabar:

That ended up working perfectly, except I have another issue, which I honestly thought this would have fixed as well, but IDK...

Enable=FALSE
Attachment 17521

Enable=TRUE
Attachment 17522

I'm assuming this is from the same Class file, but I didnt see anything that would create that "Your Price" thing.

https://www.athensartandframe.com/index.php?main_page=index&cPath=73 It's only our First Dollar frames that really show this issue. All of the frames in other subcategories have "Starting at" show up at first, but after a second, and the updater fully loads, it disappears and everything works as it should.
That's from the product being on special (rather than sale) and that the special price:

<h2 id="productPrices" class="productGeneral">
<span class="normalprice">ORIG_PRICE </span> <span class="productSpecialPrice">SPECIAL_PRICE</span><span class="productPriceDiscount"><br />Save: PERCENT_DISCOUNT off</span></h2>

Being affected by the "settings" in the class file associated with the "productSpecialPrice" group.

Similar modification(s) for that area would resolve the display of text for that type product.

As for the "flash" of starting at: type text on page load, while I wasn't able to see the "change" because I'm on a cell phone and was unable to load the page with the section in view, if you are wanting that original "Starting At:" text not to even display, would recommend defining the ZC "string" in a template override file for the affected area(s) so that it would never appear. (be assigned to double single quotes). The thing is, it looks like the added text of DPU for such modifiable product may have also been updated/changed. Though it could also be because your other product do not have a "default" selection as recommended. Ie. The option shown to a customer is best to be something like: Please choose... set as display only and default. This way, a customer can't so accidentally select an attribute related option without first actually selecting one... (ever get a return because they wanted the "larger" item but didn't realize it was available until reviewing the product again later?)

10 Dec 2017, 9:36 PM
#1429
lordzoabar avatar

lordzoabar

New Zenner

Join Date:
Nov 2017
Location:
Athens, Georgia, USA
Posts:
104
Plugin Contributions:
0

Re: Dynamic Price Updater

Yup. As you said. I actually just removed them from Specials and switched them to sale. I've only been with this company for not quite a year, so I'm still working through weird things like that. Before me, there wasn't a "dedicated" Web Admin, and it was just the other employees pretty much fiddling with Zen-Cart for the past IDEK how many years that's got it where it is, so there is a lot of similar oddities and inaccuracy hidden that I have yet to find.

Anyway, Thank-you for pointing that out.

6 Apr 2018, 7:03 PM
#1430
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

Hi hope you can help, i've gone from 3.07 to this 3.2 as my original sale prices weren't changing on products with attributes.

So my original issue with 3.07 was

For example
product loads with attribute A selected,
shows price 899 new price 749 save ..%
then you'd select attribute B from the dropdown (with normal RRP at say 749)
shows price 899 new price 649 save ..%
So the original price wouldn't change.

I upgrade to 3.2 and its only got worse!
Now i get
shows price 0 new price 649 save ..%
All original prices are 0 for items on special.

So i thought, i'll remove special, and apply a sale instead, and see what that does
shows price 0 then shows original price (!) save ...%
So its not discounting at all?!?

Help!

6 Apr 2018, 7:20 PM
#1431
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

.. had an idea.. but it wasnt it..

6 Apr 2018, 7:58 PM
#1432
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Dynamic Price Updater

Calljj:

Hi hope you can help, i've gone from 3.07 to this 3.2 as my original sale prices weren't changing on products with attributes.

So my original issue with 3.07 was

For example
product loads with attribute A selected,
shows price 899 new price 749 save ..%
then you'd select attribute B from the dropdown (with normal RRP at say 749)
shows price 899 new price 649 save ..%
So the original price wouldn't change.

I upgrade to 3.2 and its only got worse!
Now i get
shows price 0 new price 649 save ..%
All original prices are 0 for items on special.

So i thought, i'll remove special, and apply a sale instead, and see what that does
shows price 0 then shows original price (!) save ...%
So its not discounting at all?!?

Help!

Okay, so can some blanks be filled in?
ZC version?
When displaying a product that has a special, does the normalprice class exist for the product's price? (ie. can you please provide the (HTML) source code for the area where the price is shown?) for example:

<h2 id="productPrices" class="productGeneral">
Starting at: <span class="normalprice">$120.00 </span> <span class="productSpecialPriceSale">$90.00</span><br><span class="productSalePrice">Sale: $108.00</span><span class="productPriceDiscount"><br>Save: 10% off</span></h2>

Product configuration regarding price by attribute?
Price of product as entered in the product information page.

Then in the attributes controller for this product:
attribute settings for: display only, default, include attribute price in base price.

Store settings: Display price with/without tax?

Are all files incorporated into installation (remember that in some cases incorporating javascript through an editor that can ignore "unimportant" changes that the editor may not recognize the change and therefore not be up-to-date).

7 Apr 2018, 7:57 AM
#1433
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

HI, thanks for prompt reply.
Zen 1.5

<!--bof Product Price block --> <h2 id="productPrices" class="productGeneral"> <font size="0.5" color="#636363">Price: </font><span  itemscope itemtype="http://data-vocabulary.org/Offer"><meta itemprop="availability" content="in_stock" /><meta itemprop="quantity" content="1" /><meta itemprop="seller" content="" /><meta itemprop="currency" content="GBP" /><span itemprop="price" content="584.35"> <span class="normalprice">£899.00 </span> <span class="productSpecialPrice">£584.35</span><span class="productPriceDiscount"><br />Save: 35% off</span></span></span>   </h2>

Shows:

Price: £0.00 £584.35

Save: 35% off

On load the correct original price displays, then it "refreshes" and it goes to zero.

The product is set at zero price.
Product priced by attributes

Attribute flags:
No - Yes - No - Yes - Yes - No

Attribute pricing example
Total, Disc ,onetime
£899.00|£584.35 £0.00

One thing i considered, the attribute pricing does not have + signs in front.. its just a set price.

display includes tax

7 Apr 2018, 7:58 AM
#1434
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Dynamic Price Updater

Sorry, attribute flags

no- yes- yes- yes- yes - no

12 Apr 2018, 8:57 PM
#1436
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Dynamic Price Updater

Hello everyone.
I believe I broke DPU and I have no clue how.
I've installed Dual Pricing, which ended up not what we were looking for. Reverted all the changes made and uninstalled everything. Now DPU isn't working on products with attributes. :dontgetit On loading the page the price of a product is $0. Making a selection from the pulldown menu on the product's attributes renders either a $0 for the base price.
I've disabled DPU until I figure out what went wrong and prices are removed completely, which makes no absolute sense.
Help :(

12 Apr 2018, 9:08 PM
#1437
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Dynamic Price Updater

mvstudio:

Hello everyone.
I believe I broke DPU and I have no clue how.
I've installed Dual Pricing, which ended up not what we were looking for. Reverted all the changes made and uninstalled everything. Now DPU isn't working on products with attributes. :dontgetit On loading the page the price of a product is $0. Making a selection from the pulldown menu on the product's attributes renders either a $0 for the base price.
I've disabled DPU until I figure out what went wrong and prices are removed completely, which makes no absolute sense.
Help :(
That would seem to indicate that "removal" of the Dual Pricing mod was not complete in either the file and/or database portion. Considering that DPU has been disabled it no longer has a dog in the fight and what is being seen is what the curent store code is producing.

It's been a while since I've installed that mod, but I thought it modified functions that determine the price of products. If the files were not restored to the state they were in before installing the mod, then that could be the culprit.

12 Apr 2018, 10:54 PM
#1438
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Dynamic Price Updater

Found it! My fault 100% :blush:
Damage was done on a completely non related file to the plugin.
Fixed it. All good =D

13 Apr 2018, 1:21 AM
#1439
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Dynamic Price Updater

mvstudio:

Found it! My fault 100% :blush:
Damage was done on a completely non related file to the plugin.
Fixed it. All good =D
Glad the store is back in order. Suggest making a copy such that future mods can be tested on the copy rather than the live store.

14 Apr 2018, 4:26 PM
#1440
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Dynamic Price Updater

We did. The error wasn't on the mod that was uninstalled at all although I thought it was. In the middle of sleep deprivation things can go wrong in epic unexpected ways, lol!

We installed the mod that we needed TwitchWholesale with attributes and is working as it should, but DPU only shows retail price not wholesale. It shows wholesale price briefly, then switches to retail. How can I make it work?