Forums / General Questions / how to make selecting a different size auto-change the displaying price?

how to make selecting a different size auto-change the displaying price?

Views: 2,706

Results 1 to 16 of 16
7 Jun 2016, 7:25 AM
#1
win8win avatar

win8win

Zen Follower

Join Date:
Apr 2012
Location:
beijing
Posts:
258
Plugin Contributions:
1

how to make selecting a different size auto-change the displaying price?

hello
one question

URL:http://7wallarts.com/custom-c-123/7wallarts-p-321.html

about the displaying price:$99.00

once select different size,how to make the displaying price auto-change? not until click "add to cart".

Testsize
60×60cm
80×80cm ( +$12.00 )

such as if select "80×80cm ( +$12.00 )" ,it would display $111.00

what should I do?

Thanks

focus on the open source for online shoping website.
my site: best shop 24h.com

7 Jun 2016, 7:40 AM
#2
win8win avatar

win8win

Zen Follower

Join Date:
Apr 2012
Location:
beijing
Posts:
258
Plugin Contributions:
1

Re: how to make selecting a different size auto-change the displaying price?

is there such a plugin? thanks, help

focus on the open source for online shoping website.
my site: best shop 24h.com

7 Jun 2016, 7:53 AM
#3
win8win avatar

win8win

Zen Follower

Join Date:
Apr 2012
Location:
beijing
Posts:
258
Plugin Contributions:
1

Re: how to make selecting a different size auto-change the displaying price?

the following one seems to be ok:https://www.zen-cart.com/downloads.php?do=file&id=1301

but my website is v5.4,this one is only for v5.1,

i will try,and report the result later.

focus on the open source for online shoping website.
my site: best shop 24h.com

7 Jun 2016, 10:13 AM
#4
win8win avatar

win8win

Zen Follower

Join Date:
Apr 2012
Location:
beijing
Posts:
258
Plugin Contributions:
1

Re: how to make selecting a different size auto-change the displaying price?

it doesnot work.
when I looked into the code,I found that there was not new code or changed code in the position of displaying product price in tpl_product_info_display.php. too wierd

focus on the open source for online shoping website.
my site: best shop 24h.com

7 Jun 2016, 10:45 AM
#5
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: how to make selecting a different size auto-change the displaying price?

The module does work, but your template is using different names for the <div> 's that are used to recognize where to change the price.

7 Jun 2016, 6:00 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: how to make selecting a different size auto-change the displaying price?

Also the code doesn't directly modify the template files but uses javascript to update the price. There are a few things that have to be correct about the existing site in order for the javascript to function. The plugin does work and the forum for the plugin contains most if not all of any issues encountered and how to overcome them.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

8 Jun 2016, 12:43 AM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,857
Plugin Contributions:
18

Re: how to make selecting a different size auto-change the displaying price?

Why not use the built-in functions? Set the product to priced by attributes and use the attributes controller to set up the prices.
https://www.zen-cart.com/wiki/index.php/Admin_-_Catalog_-_Attributes_Controller

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

8 Jun 2016, 12:52 AM
#8
win8win avatar

win8win

Zen Follower

Join Date:
Apr 2012
Location:
beijing
Posts:
258
Plugin Contributions:
1

Re: how to make selecting a different size auto-change the displaying price?

Design75:

The module does work, but your template is using different names for the <div> 's that are used to recognize where to change the price.

could you be kind of telling me how to modify? thanks!

focus on the open source for online shoping website.
my site: best shop 24h.com

8 Jun 2016, 12:54 AM
#9
win8win avatar

win8win

Zen Follower

Join Date:
Apr 2012
Location:
beijing
Posts:
258
Plugin Contributions:
1

Re: how to make selecting a different size auto-change the displaying price?

mc12345678:

Also the code doesn't directly modify the template files but uses javascript to update the price. There are a few things that have to be correct about the existing site in order for the javascript to function. The plugin does work and the forum for the plugin contains most if not all of any issues encountered and how to overcome them.

could you be kind and tell me the specific places are the few things? thanks

focus on the open source for online shoping website.
my site: best shop 24h.com

8 Jun 2016, 12:55 AM
#10
win8win avatar

win8win

Zen Follower

Join Date:
Apr 2012
Location:
beijing
Posts:
258
Plugin Contributions:
1

Re: how to make selecting a different size auto-change the displaying price?

dbltoe:

Why not use the built-in functions? Set the product to priced by attributes and use the attributes controller to set up the prices.
https://www.zen-cart.com/wiki/index.php/Admin_-_Catalog_-_Attributes_Controller

I will try,thanks

focus on the open source for online shoping website.
my site: best shop 24h.com

8 Jun 2016, 1:24 AM
#11
win8win avatar

win8win

Zen Follower

Join Date:
Apr 2012
Location:
beijing
Posts:
258
Plugin Contributions:
1

Re: how to make selecting a different size auto-change the displaying price?

dbltoe:

Why not use the built-in functions? Set the product to priced by attributes and use the attributes controller to set up the prices.
https://www.zen-cart.com/wiki/index.php/Admin_-_Catalog_-_Attributes_Controller

I have used the attributes controller to set up the prices.

where to Set the product to priced by attributes?

Thanks

focus on the open source for online shoping website.
my site: best shop 24h.com

8 Jun 2016, 1:27 AM
#12
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,857
Plugin Contributions:
18

Re: how to make selecting a different size auto-change the displaying price?

edit the actual product and set it to Priced By Attributes

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

8 Jun 2016, 1:45 AM
#13
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: how to make selecting a different size auto-change the displaying price?

win8win:

could you be kind and tell me the specific places are the few things? thanks
Perhaps I should have said there may be a few things to verify, instead of have to do a few things. I'm assuming that since the page code has been reviewed that the page already passes an html validation. If it doesn't then it is possible that the javascript won't operate properly (throw an error). Another thing is to review other javascript applied to the page and see if there are conflicts in the order of loading. But, based on comment already provided about the div tags and the fact that the plugin looks like it offers options in the configuration menu, perhaps need to just update the settings to reference the div tags used in your template rather than the ones used in a default template.

As to the use of priced by attribute, the display of the price will be "improved" but it will not auto adjust based on each change of the dropdown. It is still a good idea to use that option in case someone visits the site and doesn't allow javascript to be run so that at least the pricing will look as desired/expected it just wouldn't auto-update unless they enabled javascript.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

8 Jun 2016, 7:22 AM
#14
win8win avatar

win8win

Zen Follower

Join Date:
Apr 2012
Location:
beijing
Posts:
258
Plugin Contributions:
1

Re: how to make selecting a different size auto-change the displaying price?

dbltoe:

edit the actual product and set it to Priced By Attributes

thanks,yes.on backend ,edit the product and there will be a selection for Priced By Attributes.
but if change to another Attribute,the price stilll won't auto-change.

focus on the open source for online shoping website.
my site: best shop 24h.com

8 Jun 2016, 7:25 AM
#15
win8win avatar

win8win

Zen Follower

Join Date:
Apr 2012
Location:
beijing
Posts:
258
Plugin Contributions:
1

Re: how to make selecting a different size auto-change the displaying price?

mc12345678:

Perhaps I should have said there may be a few things to verify, instead of have to do a few things. I'm assuming that since the page code has been reviewed that the page already passes an html validation. If it doesn't then it is possible that the javascript won't operate properly (throw an error). Another thing is to review other javascript applied to the page and see if there are conflicts in the order of loading. But, based on comment already provided about the div tags and the fact that the plugin looks like it offers options in the configuration menu, perhaps need to just update the settings to reference the div tags used in your template rather than the ones used in a default template.

As to the use of priced by attribute, the display of the price will be "improved" but it will not auto adjust based on each change of the dropdown. It is still a good idea to use that option in case someone visits the site and doesn't allow javascript to be run so that at least the pricing will look as desired/expected it just wouldn't auto-update unless they enabled javascript.

thanks ,I solved the problem.
it is simple,it is because of the template I bought is not good enough,it deleted the default code.

what i did is to add the default code back for display price.

includes/templates/yourtemplate/templates/tpl_product_info_display.php

<!--bof Product Price block -->
        <div class="product_price">

change to

<!--bof Product Price block -->
        <div id="productPrices" class="product_price">

focus on the open source for online shoping website.
my site: best shop 24h.com

8 Jun 2016, 10:22 AM
#16
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: how to make selecting a different size auto-change the displaying price?

That's great!

Might want to look into other aspects of the purchased template to see what other default ZC features have been disabled and correct them or ask the supplier to correct them. If they advertised that the template was ZC compatible/ready, then they missed the mark...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...