Jump to content

Problem saving customization data on product page


Janeon

Recommended Posts

Hi, all.

While doing my new customizations I met new problem. The thing is, that I add some customization fields to the product. The product's price depends on color, so when I choose any color in color picker - price changes from XXX to YYY. Then I enter some info to Customization fields and press "SAVE". Page refreshes and.... price becomes XXX again...it doesn't remember my color choice. :(

 

I have one shop with 1,3 PS version, there this thing works fine. Now I have 1.4.4.1. And it seems, that saveCustomization function doesn't work correctly.

 

In earlier version after pressing "Save" I can see that "group_XX=ZZ" is changing in address bar, and the system remembers my price. For example:

www.aaa.bb/product.php?id_product=16&group_2=20

 

In 1.4.4.1 there isn't any group_xx in address bar.

 

Any thoughts?

Link to comment
Share on other sites

Hello, Mike!

 

Thank you very much for the response.

 

First I thought, that it was because of my theme customizations or whatever. But now I installed fresh default 1.4.4.1 PS version without any changes.

 

Here we have default blue ipod with two customization fields:

post-137098-0-69638900-1316100951_thumb.jpg

 

Then we choose Metal color, and our price changes:

post-137098-0-64592900-1316100963_thumb.jpg

 

When we enter some data to customization fields "width" and "height", we press "Save" button and get our first "blue" view and loose our chosen metal color and it's price.

post-137098-0-69638900-1316100951_thumb.jpg

Link to comment
Share on other sites

Hi Janeon,

It appears to me that the page refreshes once you save the customization information, but it works perfectly fine if you save the customization information first and then select your color and add it to the cart. I'm not sure off the top of my head what is causing this, but if that method works for you it might be worthwhile to include instructions about saving the customization fields first to make it easier on your customers.

 

-Mike

Link to comment
Share on other sites

I know. But I need this feature to do some calculations after pressing "Save", and those calculations depend on the chosen price. Another thing is, that it isn't good for customer. He should press those buttons in any order he likes :)

 

I think, that something wrong here, because in 1.3 version everything worked fine (I mentioned about it above). Let's see our themes/prestashop/js/product.js. Version 1.3:

function saveCustomization()
{
$('#quantityBackup').val($('#quantity_wanted').val());
$('body select[@id^="group_"]').each(function() {
 $('#customizationForm').attr('action', $('#customizationForm').attr('action') + '&' + this.id + '=' + parseInt(this.value));
});
$('#customizationForm').submit();
}

Version 1.4.4.1:

function saveCustomization()
{
$('#quantityBackup').val($('#quantity_wanted').val());
customAction = $('#customizationForm').attr('action');
$('body select[id^="group_"]').each(function() {
 customAction = customAction.replace(new RegExp(this.id + '=\\d+'), this.id +'='+this.value);
});
$('#customizationForm').attr('action', customAction);
$('#customizationForm').submit();
}

 

As I understood, we activate this unction, when we press "Save" button. It seems that "replace" doesn't work here...

Am I right?

 

Unfortunately I don't have enough skills to find the reasons of this :(

Link to comment
Share on other sites

  • 1 month later...

Unfortunately, no. Prestateam also sleeps :(

 

Sorry, we tend to hit a wall after a couple months :P ... But as for your issue, I just tried to log in again using the credentials you had sent me to investigate this further, but they no longer appear to work. Can you please PM me with the new credentials so that I can look into this again?

 

-Mike

Link to comment
Share on other sites

  • 3 weeks later...

Thanks Mike, but my problem is with product attributes reverting to their default values after the customer hits the ''save'' botton with their customized text. So something like this is more like my issue.

To be more clear, please go here and choose a different font color, besides the default one, then enter whatever text you like and press ''save''. The page reloads and the font color reverts to the default value, so the customer has to go back and make the same steps again, except for the text, which is already saved...

At this point, one solution would be to make presta remember the chosen values. Another option is to remove the save button completely, as described here , only this doesn't work in presta 1.4, only in 1.3...

Link to comment
Share on other sites

Thanks Mike, but my problem is with product attributes reverting to their default values after the customer hits the ''save'' botton with their customized text. So something like this is more like my issue.

To be more clear, please go here and choose a different font color, besides the default one, then enter whatever text you like and press ''save''. The page reloads and the font color reverts to the default value, so the customer has to go back and make the same steps again, except for the text, which is already saved...

At this point, one solution would be to make presta remember the chosen values. Another option is to remove the save button completely, as described here , only this doesn't work in presta 1.4, only in 1.3...

 

Ah, I see what you mean.I'm looking at the bug report, and I do see that there is activity on this as they work through it, even if it isn't visible to you right now. I will check with the development team to find out their status on this bug and see if they will be bringing it to a resolution soon.

 

-Mike

Link to comment
Share on other sites

Hello Mike,

 

1.4.6.2 came out 25th of November, did it fix this?

 

Hi ukmacnut,

eadrian would actually be the best person to answer this, as he is the one who was having this issue. I will look into this, but in the meantime I hope he will come back to give us information related to 1.4.6.2 and this specific problem.

 

-Mike

Link to comment
Share on other sites

Hi eadrian,

I just went back and tested this for you, and it appears to be an issue with the Save button itself. If you provide the customization and just hit Add to Cart without saving, it adds the correct combination with no issues. I am going to run some more tests to try to identify why this is happening and what we can do to try to fix this for you.

 

-Mike

Link to comment
Share on other sites

  • 11 months later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...