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

Dynamic Price Updater

Views: 342,266

Results 241 to 260 of 1,701
31 Dec 2008, 4:02 PM
#241
pacdad avatar

pacdad

New Zenner

Join Date:
Jul 2006
Location:
St. Charles, MO
Posts:
30
Plugin Contributions:
0

Dynamic Price Updater

Chrome...
Ok, I (me and another zenner) have come up with a possible idea of why it's not working in FF. Everything is fine in IE, however, with the new updated version of FF, the pricing is not showing on the ADD TO CART tab. Is it possible that the new version of FF is a related issue to this problem ?
thanks,
Paul

31 Dec 2008, 5:09 PM
#242
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Dynamic Price Updater

LTCreations:

I've read all of the posts regarding the price updater and even installed the script. Although it's something long overdue in the cart, and something wonderfully oversimplified, there is a HUGE problem that is intrinsic with Zen-Cart that is still not addressed.

The obnoxious "+" accompanied with the dollar figure is absolutely 'in the way' of the pricing. If there were a method to simply 'hide' the plus sign and the accompanying dollar amount that would make developers "and" customers happy.

Here's the problem. Customer, like it or not, are not as computer savvy as we would like. They look at the numbers and the plus sign and get confused. Look at http://www.peninsulaoutfitters.com/store/index.php?main_page=product_info&cPath=66_67_93&products_id=183 . The "Product Priced by Attributes:" is of no value. If it's off, the "price updater" script won't work. If the plus sign is eliminated and the price in the attribute is entered in place of the 'additional' sum, the "price updater" won't work.
Bottom line, unless the plus sign, additional sum 'and' the "Product Priced by Attributes:" are all working in tandem the "price updater" script won't work.

The easy solution, although I'm not saying I have figured out how to make the alteration, is to simply 'hide' the plus sign and accompanying dollar increase so that the pull-down menu only has the item displayed like http://www.peninsulaoutfitters.com/flyfishingproducts/simmsfreestone.html . It's basically the same JavaScript that is used, but the option value is not revealed. Can't Zen-Cart hide the option value somehow?

Copy includes>modules>attributes.php and paste into includes>modules>YOUR_TEMPLATE_NAME folder(the overrides folder). Create the YOUR_TEMPLATE_NAME folder if you don't have one. So if your template is called custom then you will create a folder called custom inside includes>modules.

Open the attributes.php file, that's in your custom folder, in your text editor and look for this line, around line 154:

$products_options_display_price= ' (' . $products_options->fields['price_prefix'] .
                          $currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ') ';
```and replace with:

```php
$products_options_display_price= ' <span class="attributesPricePrefix">(' . $products_options->fields['price_prefix'] .
                          $currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ') </span>';
```then, in your stylesheet add this:

.attributesPricePrefix {
visibility: hidden;
}


Happy New Year!
1 Jan 2009, 3:18 AM
#243
ltcreations avatar

ltcreations

New Zenner

Join Date:
Apr 2008
Location:
Bellingham, WA
Posts:
10
Plugin Contributions:
0

Re: Dynamic Price Updater

lankeeyankee
Sweet! But before I make any changes I want to make sure I have the correct line - mine seems to have more than you quoted, but I'm just being meticulous....
On line 158:
$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;

You're saying to change that to:
$products_options_display_price= ' <span class="attributesPricePrefix">(' . $products_options->fields['price_prefix'] .
$currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ') </span>';

Seeing your <span></span> tag tells me that will work...if that's the correct line I showed above for you.
The reason I ask is because I know that the single quote is very important in the php code. Where you have '(' seems to be replaced with ATTRIBUTES_PRICE_DELIMITER_PREFIX .
The code, line 158, is found after the //normal price
Is that right? After, of course, the 'if' and 'else' statements.

In the end, I should have:
$products_options_display_price= <span class="attributesPricePrefix">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</span>;

But I'm missing the single quotes before the opening span and after the closing span tags. I'm going to try it like that and will check back here to see if you agreed or have another suggestion.

Thanks for the fix...

1 Jan 2009, 3:47 AM
#244
ltcreations avatar

ltcreations

New Zenner

Join Date:
Apr 2008
Location:
Bellingham, WA
Posts:
10
Plugin Contributions:
0

Re: Dynamic Price Updater

I tried the above as show, but it made the page go blank. I changed the code to include '<span class=''attributesPricePrefix">(' before the . and the remaining code, closed it with the . ')</span>'; but it didn't work. That simply added all the code to the drop-down menu so that the + and additional price in addition to the <span></span> coding was also included.
I tried div tags, but no difference.

I think wherever the ATTRIBUTES_PRICE_DELIMITER_PREFIX is referenced is where the <span></span> tags should go.
This theory proves correct. I inadvertently placed the ...._PREFIX at the end of the php code instead of replacing that with the ..._SUFFIX and found that the parenth was reversed around the plus sign and added dollar figure.
So this puts me on the right track, although still on the hunt...

Any suggestions where to find the prefix/suffix in the php where I could put the span tag around that code?

1 Jan 2009, 8:35 PM
#245
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Dynamic Price Updater

LTCreations:

lankeeyankee
Sweet! But before I make any changes I want to make sure I have the correct line - mine seems to have more than you quoted, but I'm just being meticulous....
On line 158:
$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;

You're saying to change that to:
$products_options_display_price= ' <span class="attributesPricePrefix">(' . $products_options->fields['price_prefix'] .
$currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ') </span>';

Seeing your <span></span> tag tells me that will work...if that's the correct line I showed above for you.
The reason I ask is because I know that the single quote is very important in the php code. Where you have '(' seems to be replaced with ATTRIBUTES_PRICE_DELIMITER_PREFIX .
The code, line 158, is found after the //normal price
Is that right? After, of course, the 'if' and 'else' statements.

In the end, I should have:
$products_options_display_price= <span class="attributesPricePrefix">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</span>;

But I'm missing the single quotes before the opening span and after the closing span tags. I'm going to try it like that and will check back here to see if you agreed or have another suggestion.

Thanks for the fix...

Ahh, so sorry, I should have mentioned that this was for v 1.3.7.1 so it could be different if you are using 1.3.8a. My attributes file doesn't have ATTRIBUTES_PRICE_DELIMITER_PREFIX etc.

It should work if you change your file to read:

$products_options_display_price= '<span class="attributesPricePrefix">' . 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 . '</span>';
```Copy and paste this to replace the original line and add the rule to the stylesheet. The single and double quotes are correct. Let me know if you still have a problem and I will install a fresh copy of 1.3.8a on my local box to get it to work right.
1 Jan 2009, 10:11 PM
#246
ltcreations avatar

ltcreations

New Zenner

Join Date:
Apr 2008
Location:
Bellingham, WA
Posts:
10
Plugin Contributions:
0

Re: Dynamic Price Updater

That didn't work.... :no:
What it did do was display the span tags and included class tag inside the drop-down menu surrounding the parenthesis, plus sign and additional dollar figure.
I had the same results yesterday in trying variations of what you had suggested.

I was talking to someone else who knows php 'pretty well', and he told me that php won't read html. His suggestion was to add the base price before the plus sign so the 'mentally retarded customers' who are having so much trouble trying to figure out what all the numbers and plus sign mean, they will see the base price plus the additional amount and the total will be found below the drop-down as it's placed now.
But...that seems pretty lame to add more unwanted information into the drop-down menu when I'm trying to remove what's there now.

Do you know where the ATTRIBUTES_PRICE_DELIMITER_SUFFIX is found?
Would it make sense to put the span tags around whever that 'call' is found...in whatever module/file?

There must be an answer...but I don't know php well enough to figure it out.

1 Jan 2009, 11:01 PM
#247
ltcreations avatar

ltcreations

New Zenner

Join Date:
Apr 2008
Location:
Bellingham, WA
Posts:
10
Plugin Contributions:
0

Re: Dynamic Price Updater

What if....
In attributes.php, can't the statement
if ($new_attributes_price == 0) {
$products_options_display_price= '';
} else {
$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;
}
..be moved so that it's part of the "value" in the pull-down menu?
I have a JS that uses nearly the exact same process (look here http://www.peninsulaoutfitters.com/flyfishingproducts/simmsfreestone.html ) to read what's in the "value" of the <option value="blah blah..anything can go here, even +$28.99"></option> and the +$28.99 is added to the base price, then appears in the <input name="tot" /> so that each change is automatically updated and the customer can see immediately the price total.
So, in theory, the resolve to what I'm seeking would be moving the code for the products options into the "value" field of the <option></option> code.
But, I have no clue how to tell the php to do that...

If there 'is' a way to do that I'm sure the Zenners would love whoever comes up with that resolve.

2 Jan 2009, 1:31 AM
#248
ltcreations avatar

ltcreations

New Zenner

Join Date:
Apr 2008
Location:
Bellingham, WA
Posts:
10
Plugin Contributions:
0

Re: Dynamic Price Updater

How about this....

I have the JS that will do 'exactly' what I want and can be manipulated as I want for each product. If I implement that script, which is simple to do, how do I pass the information from that script into the shopping cart when the customer clicks on the "Add to Cart" button?

2 Jan 2009, 8:38 PM
#249
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Dynamic Price Updater

I guess I should have checked before I opened my big mouth!:laugh:

My fix doesn't work with drop downs, only radio buttons and perhaps check boxes in v1.3.7.1. I am not sure how you can get the same results with drop downs but it has to be possible.

Can't help with the JS stuff, not strong enough to give any help. Sorry!!:blush:

3 Jan 2009, 8:57 PM
#250
pacdad avatar

pacdad

New Zenner

Join Date:
Jul 2006
Location:
St. Charles, MO
Posts:
30
Plugin Contributions:
0

Re: Dynamic Price Updater

pacdad:

Chrome...
Ok, I (me and another zenner) have come up with a possible idea of why it's not working in FF. Everything is fine in IE, however, with the new updated version of FF, the pricing is not showing on the ADD TO CART tab. Is it possible that the new version of FF is a related issue to this problem ?
thanks,
Paul

OK, So I went back and reinstalled earlier version of Firefox. Alas, I still have same situation. I can not get Price Updater to show up on the "add to cart" tab in FF. Works well in I.E. . Anyone have any thoughts ? Help would be most appreciative.
thanks,
Paul
:wacko:

6 Jan 2009, 1:08 PM
#251
pacdad avatar

pacdad

New Zenner

Join Date:
Jul 2006
Location:
St. Charles, MO
Posts:
30
Plugin Contributions:
0

Re: Dynamic Price Updater

pacdad:

OK, So I went back and reinstalled earlier version of Firefox. Alas, I still have same situation. I can not get Price Updater to show up on the "add to cart" tab in FF. Works well in I.E. . Anyone have any thoughts ? Help would be most appreciative.
thanks,
Paul
:wacko:

Well, we got it fixed, kinda by accident. I installed a SQL file, and reinstalled it (dual pricing) and it's up again.

Consider THIS issue C-L-O-S-E-D
:clap:

6 Jan 2009, 1:44 PM
#252
chrome avatar

chrome

Zen Follower

Join Date:
Jul 2005
Location:
Wales, UK
Posts:
392
Plugin Contributions:
0

Re: Dynamic Price Updater

Hi all

Seems the new year and the lead up to it have been more busy than I anticipated... No change there then... Sorry all

pacdad, I'm glad you got the issue sorted... Sorry I couldn't help further but to be honest given the nature of the fix I doubt I would've been able to do too much

As always many thanks to lankeeyankee for the kind words and continued support of the Updater

LTCreations: you have stumbled on one of the Achilles heels of the Updater... This has been breaking my brain on and off for a while now... I think I have the plans for V2 set in my head now so I'm going to set up a new test shop and start playing... I feel a renewed vigour!

I hope everyone had a good Yule season and New Year... The parts I remember were very good :smile:

Thanks all and again sorry for the lack of support

Dan

18 Jan 2009, 7:10 PM
#253
jmacdoug avatar

jmacdoug

New Zenner

Join Date:
Jun 2007
Location:
NJ
Posts:
84
Plugin Contributions:
0

Re: Dynamic Price Updater

Can someone tell me the proper way to uninstall this? I installed in on zc 1.3.8a and now there is a debug message popping up on my site www.modebook.com/zc

:(

I can't have it happen and would greatly appreciate some help unless someone can actually get it to work for me.

18 Jan 2009, 8:11 PM
#254
pacdad avatar

pacdad

New Zenner

Join Date:
Jul 2006
Location:
St. Charles, MO
Posts:
30
Plugin Contributions:
0

Re: Dynamic Price Updater

jmacdoug:

Can someone tell me the proper way to uninstall this? I installed in on zc 1.3.8a and now there is a debug message popping up on my site www.modebook.com/zc

:(

I can't have it happen and would greatly appreciate some help unless someone can actually get it to work for me.

Did you try editing the: jscript_updater.php on your site?
This will turn off the Debug results.
Open, edit and change the var=debugTrue to False

// Second price setting
// the following settings allow a second price to be displayed... if a page is very long this allows you to add another price display
// thanks to Ryk on the Zen Cart forums for the idea and pointing out the issue
var _secondPrice = 'cartAdd'; // set this to either false for disabled or supply the ID of an element for the price to appear BEFORE... for example, cartAdd
var _SPDisplay = 'always'; // governs the behaviour of the second... 'always' permanently displays and 'update' shows the second price only when an attribute is selected
var objSP = false; // please don't adjust this

// debug settings
var _debug = true; // set to false to disable debug output
var _db = '';
var _dbdiv = false;

function init() { // discover the selects that are required to adjust the main price
var centre = document.getElementById('productGeneral');
var objSel = centre.getElementsByTagName('SELECT');
var objInp = centre.getElementsByTagName('INPUT');
var db = '';
var _flag = false; // flag to decide if a load of attribute information is needed

18 Jan 2009, 8:35 PM
#255
jmacdoug avatar

jmacdoug

New Zenner

Join Date:
Jun 2007
Location:
NJ
Posts:
84
Plugin Contributions:
0

Re: Dynamic Price Updater

hmmmm...I can't seem to locate the file jscript_updater.php

hint?:wacko:

18 Jan 2009, 8:41 PM
#256
pacdad avatar

pacdad

New Zenner

Join Date:
Jul 2006
Location:
St. Charles, MO
Posts:
30
Plugin Contributions:
0

Re: Dynamic Price Updater

it's the only file you downloaded for this Mod.
I'm assuming you FTP'd it to: includes/modules/pages/product_info/ ?
Should be in there.

18 Jan 2009, 8:49 PM
#257
jmacdoug avatar

jmacdoug

New Zenner

Join Date:
Jun 2007
Location:
NJ
Posts:
84
Plugin Contributions:
0

Re: Dynamic Price Updater

My bad. :oops:

I made the change and all is well now.

Sorry about that. Sometimes the obvious is looking right at you and you pass it by.

Thanks a bunch for the lightning fast responses!

Jeff

18 Jan 2009, 8:52 PM
#258
pacdad avatar

pacdad

New Zenner

Join Date:
Jul 2006
Location:
St. Charles, MO
Posts:
30
Plugin Contributions:
0

Re: Dynamic Price Updater

jmacdoug:

My bad. :oops:

I made the change and all is well now.

Sorry about that. Sometimes the obvious is looking right at you and you pass it by.

Thanks a bunch for the lightning fast responses!

Jeff

You're welcome. I only know, cause of the issues I had. Glad to help, now......... Pay it Forward
:bigups:

25 Jan 2009, 5:16 PM
#259
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Dynamic Price Updater

JasonRocket:

I'm now updating it with setTimeout function to get it to update.

setTimeout("makeChange()", 500);
function makeChange() {
var addDiscountHere = document.getElementById("addDiscountHere"); //get place to add discount amount

var quantity02 = quantity;
if (quantity02 > 9) {
var discountAdded = "-10%";
} else {
var discountAdded = "no quantity discount";
}
addDiscountHere.firstChild.nodeValue = discountAdded;
setTimeout("makeChange()", 500);

}

Where did you assign "addDiscountHere"? I would like to get this to work with quantity discounts, too. I see that your function has hardcoded values so I would have to clone the function using a different element ID and set different discount values for the different quantity discounts we offer.

Thanks!

Matt

25 Jan 2009, 8:32 PM
#260
marcojimj avatar

marcojimj

New Zenner

Join Date:
Jan 2009
Posts:
6
Plugin Contributions:
0

Re: Dynamic Price Updater

I'm looking for a "custom product" mod where the customer can select material, grade, & thickness, then enter length, and width. the mod would then calculate price and weight based on material and grade related properties and then send it to the order. Does this exist??? Thanks P.S. as a newbie this is driving me Wacko.:wacko: