Jump to content

[Solved] Can I Set Product Attributes To Decrease Final Price?


Recommended Posts

Hello Prestashop users ;-)

This is my first post here on the forums but I've been browsing them and getting great information all along. You guys are my favorite resource.

 

My question is the following:

I have a product priced at $1695.00, and it has many selectable attributes. One attribute however needs to affects the product price negatively by $100. In the Combinations Generator I set the impact on the price to -100 but it ignored the negative value and now in the store it adds $100 to when that option is selected.

 

Is there any way to accomplish decreasing the price when a particular attribute is selected?

 

My site URL is http://store.candlsaddles.com

The product in question is http://store.candlsa...west-trail.html

The attribute is "Tooled/Smooth" when you select smooth it needs to decrease the price.

 

Thanks in advanced!

Josiah

Edited by techfirestudio (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Hello Prestashop users ;-)

This is my first post here on the forums but I've been browsing them and getting great information all along. You guys are my favorite resource.

 

My question is the following:

I have a product priced at $1695.00, and it has many selectable attributes. One attribute however needs to affects the product price negatively by $100. In the Combinations Generator I set the impact on the price to -100 but it ignored the negative value and now in the store it adds $100 to when that option is selected.

 

Is there any way to accomplish decreasing the price when a particular attribute is selected?

 

My site URL is http://store.candlsaddles.com

The product in question is http://store.candlsa...west-trail.html

The attribute is "Tooled/Smooth" when you select smooth it needs to decrease the price.

 

Thanks in advanced!

Josiah

Well... just choose 'Reduction' instead of 'Increase' from drop down menu. What's the problem?

Screenshot

Share this post


Link to post
Share on other sites

Thanks, guys. It workes! But with several hundred combinations per product and then several hundred products on the way editing them all to get negative values is going to take weeks. And some combinations contain values that increase and decrease, and they don't cancel out properly. I apologize for being such a dumy here ;-)

Doing it the way you explained is just going to take for to much human resources. I'm running a one man show here so is there a way to specify a negative value during the combination generator process? I tried entering a negative sign "-" in the "Impact on product price" field but it doesn't just ignores it and makes it a positive.

 

Thanks again.

Josiah

Share this post


Link to post
Share on other sites

Thanks, guys. It workes! But with several hundred combinations per product and then several hundred products on the way editing them all to get negative values is going to take weeks. And some combinations contain values that increase and decrease, and they don't cancel out properly. I apologize for being such a dumy here ;-)

Doing it the way you explained is just going to take for to much human resources. I'm running a one man show here so is there a way to specify a negative value during the combination generator process? I tried entering a negative sign "-" in the "Impact on product price" field but it doesn't just ignores it and makes it a positive.

 

Thanks again.

Josiah

Yes, now i see.

I think it's a bug...

 

Here is how to fix:

 

1) Open admin/themes/default/template/controllers/attribute_generator/content.tpl

find

if (!isNaN(element_price) && element_price > 0)

and remove && element_price > 0:

if (!isNaN(element_price))

 

2)Open controllers/admin/AdminAttributeGeneratorController.php

Find

$price += (float)preg_replace('/[^0-9.]/',

 

Add '-' sign:

$price += (float)preg_replace('/[^0-9-.]/'

 

Now it should work...

Edited by doubleD (see edit history)
  • Like 3

Share this post


Link to post
Share on other sites

Yes, now i see.

I think it's a bug...

 

Here is how to fix:

 

1) Open admin/themes/default/template/controllers/attribute_generator/content.tpl

find

if (!isNaN(element_price) && element_price > 0)

and remove && element_price > 0:

if (!isNaN(element_price))

 

2)Open controllers/admin/AdminAttributeGeneratorController.php

Find

$price += (float)preg_replace('/[^0-9.]/',

 

Add '-' sign:

$price += (float)preg_replace('/[^0-9-.]/'

 

Now it should work...

 

Hello doubleD, I regenerated the attribute combinations this morning and after sometime of loading the page it said the server had disconected. I went to the product in the front office and played with the attributes and found that the negative values were working but some of the attributes had failed to generate combinations so that when selected it would say that the "selected value isn't a valid combination for this product" (or something along those lines). So assuming that it had failed to generate them all I told firefox to "try again" on the combinations page that had failed to load. It resulted in a error 500 internal server error, and now no page on my site can be accessed. The back office also returns a blank page or error 500. I can access the servers files via ftp, but cannot enter the back office or front office. Does anyone know a way to fix this? If not I will roll back the server.

Thank you for your help!

Share this post


Link to post
Share on other sites

Hello doubleD, I regenerated the attribute combinations this morning and after sometime of loading the page it said the server had disconected. I went to the product in the front office and played with the attributes and found that the negative values were working but some of the attributes had failed to generate combinations so that when selected it would say that the "selected value isn't a valid combination for this product" (or something along those lines). So assuming that it had failed to generate them all I told firefox to "try again" on the combinations page that had failed to load. It resulted in a error 500 internal server error, and now no page on my site can be accessed. The back office also returns a blank page or error 500. I can access the servers files via ftp, but cannot enter the back office or front office. Does anyone know a way to fix this? If not I will roll back the server.

Thank you for your help!

 

Try to turn on Dev mode and see what errors are displayed then:

File config/defines.inc.php define('_PS_MODE_DEV_', true);

 

I assume your server might have encountered php timeout error...

 

I can access your website now.

Edited by doubleD (see edit history)

Share this post


Link to post
Share on other sites

Try to turn on Dev mode and see what errors are displayed then:

File config/defines.inc.php define('_PS_MODE_DEV_', true);

 

ok, just turned on dev mode and now it displays the following:

 

Fatal error: Uncaught PrestaShop Fatal error: no utf-8 support. Please check your server configuration. thrown in /hermes/bosoraweb041/b1677/ipg.kjiazuroweste4repcom/candl/store/classes/db/DbPDO.php on line 62

Share this post


Link to post
Share on other sites

ok, just turned on dev mode and now it displays the following:

 

Fatal error: Uncaught PrestaShop Fatal error: no utf-8 support. Please check your server configuration. thrown in /hermes/bosoraweb041/b1677/ipg.kjiazuroweste4repcom/candl/store/classes/db/DbPDO.php on line 62

I don't see the error on you website, it's working now.

However there is a Bug Report for the error, maybe you will find an answer there.

Share this post


Link to post
Share on other sites

I don't see the error on you website, it's working now.

However there is a Bug Report for the error, maybe you will find an answer there.

 

Ok, that is random. It was consitently giving that error until now. Guess it just need a few minutes, but after working in IT for some time when systems fix themselves it always makes me nervous. Leaves me wondering when the problem will show it's face again.

I appreciate the help! Have a great day!

Share this post


Link to post
Share on other sites

Ok, that is random. It was consitently giving that error until now. Guess it just need a few minutes, but after working in IT for some time when systems fix themselves it always makes me nervous. Leaves me wondering when the problem will show it's face again.

I appreciate the help! Have a great day!

There are a lot of combinations on your website, really a lot :)

I think, you should increase php time execution and memory limit values when executing attribute generation.

Or even better, generate them on localhost, and then transfer the database :) or, at least, generate them on test server to see how much time it'll take.

Edited by doubleD (see edit history)

Share this post


Link to post
Share on other sites

There are a lot of combinations on your website, really a lot :)

I think, you should increase php time execution and memory limit values when executing attribute generation.

Or even better, generate them on localhost, and then transfer the database :) or, at least, generate them on test server to see how much time it'll take.

 

How would I go about increasing the excution and memory limit? I can do html, css, and some java-script but I'm no good with php.

I'll look into generating them locally, would that require me to set up PS on my computer and then just upload the database tables that apply to attributes?

Share this post


Link to post
Share on other sites

How would I go about increasing the excution and memory limit? I can do html, css, and some java-script but I'm no good with php.

I'll look into generating them locally, would that require me to set up PS on my computer and then just upload the database tables that apply to attributes?

RE. Php Config

That depends on your hosting provider.

Normally, You should be able to change those values in your hosting cpanel (PHP configuration).

memory_limit and max_execution_time values

 

RE. Local install

Yes, you can use XAMPP, WAMP or else to setup environment for Prestashop.

You will need a copy of all files and the database (ie backup).

Share this post


Link to post
Share on other sites

RE. Php Config

That depends on your hosting provider.

Normally, You should be able to change those values in your hosting cpanel (PHP configuration).

memory_limit and max_execution_time values

 

RE. Local install

Yes, you can use XAMPP, WAMP or else to setup environment for Prestashop.

You will need a copy of all files and the database (ie backup).

 

Thank you, I found specific instructions for my hosting provider. I will be looking into a local install for other reasons, because I have found a solution to the problem.

 

The memory and time limitations are not the issue. The problem is that the combinations generator supports a about 1000 - 3000 combinations per product. I have approximately 9 attribute categories with average of 6 options in each. That calculates out to more than 500,000 combinations per product, there is no way the attributes generator can do that. The solution is to purchase the Attribute Wizard Pro developed by Tomerg3. For the help of those of you having similar issues I'll post the link to his thread.

 

http://www.prestashop.com/forums/topic/47363-module-attribute-wizard-pro-create-an-unlimited-number-of-attributes-and-display-as-radio-button-checkbox-dropdown-textbox-teaxtarea-files/

 

Have a great day!

Share this post


Link to post
Share on other sites

  • 2 years later...

Hi guys, I tried the fix above on Prestashop 1.6 and it disabled my attributes generator - I could select the attributes but they didn't generate.

 

I did notice that the line:

 

 $price += (float)preg_replace('/[^0-9.]/',

 

was repeated twice - should I make the change in both places?

 

Thanks

Share this post


Link to post
Share on other sites

  • 1 month later...
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More