Jump to content
Kristjan001

Problem with the Product Attributes drop-down menu on shop page

Recommended Posts

Hi, after the new version of Prestashop (1.6.1.0) I found a strange problem. When I'm creating a product with different combinations (different atributes with drop-down menu), then I can't choose these combinations on the shop webpage. I choose some combination at the product, the shop shows me some seconds selected product and after that it updates the product to the default combination.

 

For example. One product has combinations 1 (default), 2 and 3. When I choose on the shop's webpage combination 2, then after some seconds the shop update the view to the default combination back. So the client can't either see the details of the combination nor add it to the cart.

Can somebody say, where is the problem. Before the last Prestashop upgrade this function worked perfect.

 

This problem isn't in mobile version.

 

Kristjan001

Edited by Kristjan001 (see edit history)
  • Like 2

Share this post


Link to post
Share on other sites

I got it figured out. 

Preferences > products > check "Allow ordering of outofstock products"

 

 

thanks.

Share this post


Link to post
Share on other sites

Sorry, but this isn't a solution. I have enabled this function from first day of using prestashop. The problem is with PC browser version of Prestashop. Mobile version is workig.

Share this post


Link to post
Share on other sites

Same problem here, if i pick a combination in the product page (front-end), it's refresh the page and select the default combination. Any one knows the fix?

Share this post


Link to post
Share on other sites

I found the solution in my case and posted it in another case, but I advise:

1. check your Prestashop version. My administration profile shows 1.6.1.0, but the server showed 1.6.0.14. So I updated the version again.

2. disable the cross-selling (for example: Modules>cart block> show cross-selling.

 

I solved this problem so.

Share this post


Link to post
Share on other sites

I am not using cross-selling.   It is not even installed, so that is not the problem.

The attributes drop down menu works fine on mobile devices, but not on PC's.

 

Can someone please help me?

Share this post


Link to post
Share on other sites

Have You checked the cross-selling? I didn't use it, but after last update to 1.16.1.0 it was automatically enabled. So check it. Before this I updated the verion again, because on the website I had sign "Prestashop 1.16.1.0", but in administration site I had information about 1.16.0.14. It can be that the update wasn't successful. I solved my problem.

Share this post


Link to post
Share on other sites

Just read this post looking for something else, gone to my product page and turns out i have this problem too!

 

So... does anybody have any idea why my product page reloads when you choose an attribute but when i try to recreate the problem on demo.prestashop.com the problem does not occur? In fact their page doesn't load at all, it just instantly changes the price/picture/colour. 

 

Any ideas would be appreciated to help me track down the fault. 

 

Thanks in advance!

 

Mike

Share this post


Link to post
Share on other sites

That is brilliant! Thank you so much for your help. Works a treat.

 

I changed the separator to comma and tested, didnt work.

 

Changed it back to hyphen and tested it. WORKS!

 

This is solved!

 

Thank you!  :lol:

Share this post


Link to post
Share on other sites

try preference > products > check the check box " separate attributes anchor" and pick "-"

 

Thanks a lot Kevin! I had the same issue, and your sugestion worked fine!

  • Like 1

Share this post


Link to post
Share on other sites

I'm getting this same issue with PS 1.7.1.1 and setting "separate attributes anchor" to "-" didn't work for me.

Share this post


Link to post
Share on other sites

The same problem with prestashop 1.7 , and setting "separate attributes anchor" to "-" didn't work , any help , please :)

Share this post


Link to post
Share on other sites

Try to set up attributes this way , in my case when I set up 2 attributes together then it works . When I choose one attribut and the second separate then attributes won't work together , try set both attributes together not separate in one line if you know what I mean .

Share this post


Link to post
Share on other sites

Sorry for my poor english , try add atributes like tags in product, one after one and then press generate . 

Share this post


Link to post
Share on other sites

Still not working for me in Presta 1.7

 

 

Sorry for my poor english , try add atributes like tags in product, one after one and then press generate . 

 

I don't now what you mean MarcinA.

Share this post


Link to post
Share on other sites

Same problem here too, combinations work without friedly URLs enabled but when you activate friendly URLs you can see all combinations and you can select other than default but it refreshes to back default, if you have same picture in combinations then it works.

 

I think it's server image rewrite config issue with nginx. Sorry I i don't know how to config this, if some one know, please share

 

Thank you

Share this post


Link to post
Share on other sites

Not the same issue on my side, boxes stay empty.

I know, your problem is diffirend from starting post and previous posts

Edited by Marksaa (see edit history)

Share this post


Link to post
Share on other sites

Same problem here too, combinations work without friedly URLs enabled but when you activate friendly URLs you can see all combinations and you can select other than default but it refreshes to back default, if you have same picture in combinations then it works.

 

I think it's server image rewrite config issue with nginx. Sorry I i don't know how to config this, if some one know, please share

 

Thank you

Found solution to this

 

go to SEO and change product url :

 

{category:/}{id}{-:id_product_attribute}-{rewrite}{-:ean13}.html

 

to

 

{category:/}{id}{-:id_product_attribute}-{rewrite}.html

 

save and that's it

  • Like 1

Share this post


Link to post
Share on other sites

I had this annoying problem too, I've attached my fix.

File: controllers/front/ProductController.php

Find this:

 public function canonicalRedirection($canonical_url = '')
    {
        if (Validate::isLoadedObject($this->product)) {
            if (!$this->product->hasCombinations()) {
                unset($_GET['id_product_attribute']);
            } else if (!Tools::getValue('id_product_attribute') || Tools::getValue('rewrite') !== $this->product->link_rewrite) {
                $_GET['id_product_attribute'] = Product::getDefaultAttribute($this->product->id);
            }

            $id_product_attribute = $this->getIdProductAttribute();
            parent::canonicalRedirection($this->context->link->getProductLink(
                $this->product,
                null,
                null,
                null,
                null,
                null,
                $id_product_attribute
            ));
        }
    }

Replace with:

 public function canonicalRedirection($canonical_url = '')
    {

        if (Validate::isLoadedObject($this->product)) {
            $check = Product::getDefaultAttribute($this->product->id); // Does it have any attributes / combinations?
            if($check === 0) {
                unset($_GET['id_product_attribute']);
            } else {
                // id_product_attribute will be set in the url
                
                if(!isset($_GET['id_product_attribute'])) { // if not set in url, get the default value
                    $_GET['id_product_attribute'] = Product::getDefaultAttribute($this->product->id);
                }

            }

            $id_product_attribute = $this->getIdProductAttribute();
            parent::canonicalRedirection($this->context->link->getProductLink(
                $this->product,
                null,
                null,
                null,
                null,
                null,
                $id_product_attribute
            ));
        }
    }


If you still have a problem, I would clear the cache.

Hope this helps!

Edited by mailbox@privilegedso (see edit history)
  • Like 3

Share this post


Link to post
Share on other sites
Dnia 31.08.2017 o 2:51 PM, Marksaa napisał:

Found solution to this

 

go to SEO and change product url :

 

{category:/}{id}{-:id_product_attribute}-{rewrite}{-:ean13}.html

 

to

 

{category:/}{id}{-:id_product_attribute}-{rewrite}.html

 

save and that's it

This is it!! :) Thank You Marksaa

  • Like 1

Share this post


Link to post
Share on other sites

prefereces / product prefereces

 

Product Page

display product attributes that have not been entered in the product page

make this YES

save

Adsız.jpg

Share this post


Link to post
Share on other sites

Hi, I had same problem. Then I did some research. Then I understand that the problem is product comment module.  actually the problem is not the module itself. problem is changing this module position in product page. I have moved this module to productextracontent table from it's original position (productfooter). When I moved the module back to the footer I solved the problem. But it's not enough for me. Because it had to be in productextracontent table. Then I did more research.  Then I found the module which fixed.

 

9.1.9

- updated module workflow with position displayProductExtraContent

- added number of comments to product list reviews widget (previously there was a average grade)

 

Now I'm using this version. And my product attributes don't have any problem while changing up or down

 

(I'm using prestashop 1.7.2.4 and php 7.0 version)

Edited by Matara (see edit history)

Share this post


Link to post
Share on other sites

Marksaa: Thanks. yeah this bugged me for a while but the solution was pretty easy. I added the EAN to my combos, as they were not imported during migration from 1.6 - 1.7.

Share this post


Link to post
Share on other sites
On 26.10.2017 at 3:02 PM, mailbox@privilegedso said:

I had this annoying problem too, I've attached my fix.

File: controllers/front/ProductController.php

Find this:


 public function canonicalRedirection($canonical_url = '')
    {
        if (Validate::isLoadedObject($this->product)) {
            if (!$this->product->hasCombinations()) {
                unset($_GET['id_product_attribute']);
            } else if (!Tools::getValue('id_product_attribute') || Tools::getValue('rewrite') !== $this->product->link_rewrite) {
                $_GET['id_product_attribute'] = Product::getDefaultAttribute($this->product->id);
            }

            $id_product_attribute = $this->getIdProductAttribute();
            parent::canonicalRedirection($this->context->link->getProductLink(
                $this->product,
                null,
                null,
                null,
                null,
                null,
                $id_product_attribute
            ));
        }
    }

Replace with:


 public function canonicalRedirection($canonical_url = '')
    {

        if (Validate::isLoadedObject($this->product)) {
            $check = Product::getDefaultAttribute($this->product->id); // Does it have any attributes / combinations?
            if($check === 0) {
                unset($_GET['id_product_attribute']);
            } else {
                // id_product_attribute will be set in the url
                
                if(!isset($_GET['id_product_attribute'])) { // if not set in url, get the default value
                    $_GET['id_product_attribute'] = Product::getDefaultAttribute($this->product->id);
                }

            }

            $id_product_attribute = $this->getIdProductAttribute();
            parent::canonicalRedirection($this->context->link->getProductLink(
                $this->product,
                null,
                null,
                null,
                null,
                null,
                $id_product_attribute
            ));
        }
    }


If you still have a problem, I would clear the cache.

Hope this helps!

After a few hours of searching, only this solution worked

Share this post


Link to post
Share on other sites
On 2017-10-26 at 9:02 AM, mailbox@privilegedso said:

I had this annoying problem too, I've attached my fix.

File: controllers/front/ProductController.php

Find this:


 public function canonicalRedirection($canonical_url = '')
    {
        if (Validate::isLoadedObject($this->product)) {
            if (!$this->product->hasCombinations()) {
                unset($_GET['id_product_attribute']);
            } else if (!Tools::getValue('id_product_attribute') || Tools::getValue('rewrite') !== $this->product->link_rewrite) {
                $_GET['id_product_attribute'] = Product::getDefaultAttribute($this->product->id);
            }

            $id_product_attribute = $this->getIdProductAttribute();
            parent::canonicalRedirection($this->context->link->getProductLink(
                $this->product,
                null,
                null,
                null,
                null,
                null,
                $id_product_attribute
            ));
        }
    }

Replace with:


 public function canonicalRedirection($canonical_url = '')
    {

        if (Validate::isLoadedObject($this->product)) {
            $check = Product::getDefaultAttribute($this->product->id); // Does it have any attributes / combinations?
            if($check === 0) {
                unset($_GET['id_product_attribute']);
            } else {
                // id_product_attribute will be set in the url
                
                if(!isset($_GET['id_product_attribute'])) { // if not set in url, get the default value
                    $_GET['id_product_attribute'] = Product::getDefaultAttribute($this->product->id);
                }

            }

            $id_product_attribute = $this->getIdProductAttribute();
            parent::canonicalRedirection($this->context->link->getProductLink(
                $this->product,
                null,
                null,
                null,
                null,
                null,
                $id_product_attribute
            ));
        }
    }


If you still have a problem, I would clear the cache.

Hope this helps!

 

On 2017-10-26 at 9:02 AM, mailbox@privilegedso said:

I had this annoying problem too, I've attached my fix.

File: controllers/front/ProductController.php

Find this:


 public function canonicalRedirection($canonical_url = '')
    {
        if (Validate::isLoadedObject($this->product)) {
            if (!$this->product->hasCombinations()) {
                unset($_GET['id_product_attribute']);
            } else if (!Tools::getValue('id_product_attribute') || Tools::getValue('rewrite') !== $this->product->link_rewrite) {
                $_GET['id_product_attribute'] = Product::getDefaultAttribute($this->product->id);
            }

            $id_product_attribute = $this->getIdProductAttribute();
            parent::canonicalRedirection($this->context->link->getProductLink(
                $this->product,
                null,
                null,
                null,
                null,
                null,
                $id_product_attribute
            ));
        }
    }

Replace with:


 public function canonicalRedirection($canonical_url = '')
    {

        if (Validate::isLoadedObject($this->product)) {
            $check = Product::getDefaultAttribute($this->product->id); // Does it have any attributes / combinations?
            if($check === 0) {
                unset($_GET['id_product_attribute']);
            } else {
                // id_product_attribute will be set in the url
                
                if(!isset($_GET['id_product_attribute'])) { // if not set in url, get the default value
                    $_GET['id_product_attribute'] = Product::getDefaultAttribute($this->product->id);
                }

            }

            $id_product_attribute = $this->getIdProductAttribute();
            parent::canonicalRedirection($this->context->link->getProductLink(
                $this->product,
                null,
                null,
                null,
                null,
                null,
                $id_product_attribute
            ));
        }
    }


If you still have a problem, I would clear the cache.

Hope this helps!

 

On 2017-10-26 at 9:02 AM, mailbox@privilegedso said:

I had this annoying problem too, I've attached my fix.

File: controllers/front/ProductController.php

Find this:


 public function canonicalRedirection($canonical_url = '')
    {
        if (Validate::isLoadedObject($this->product)) {
            if (!$this->product->hasCombinations()) {
                unset($_GET['id_product_attribute']);
            } else if (!Tools::getValue('id_product_attribute') || Tools::getValue('rewrite') !== $this->product->link_rewrite) {
                $_GET['id_product_attribute'] = Product::getDefaultAttribute($this->product->id);
            }

            $id_product_attribute = $this->getIdProductAttribute();
            parent::canonicalRedirection($this->context->link->getProductLink(
                $this->product,
                null,
                null,
                null,
                null,
                null,
                $id_product_attribute
            ));
        }
    }

Replace with:


 public function canonicalRedirection($canonical_url = '')
    {

        if (Validate::isLoadedObject($this->product)) {
            $check = Product::getDefaultAttribute($this->product->id); // Does it have any attributes / combinations?
            if($check === 0) {
                unset($_GET['id_product_attribute']);
            } else {
                // id_product_attribute will be set in the url
                
                if(!isset($_GET['id_product_attribute'])) { // if not set in url, get the default value
                    $_GET['id_product_attribute'] = Product::getDefaultAttribute($this->product->id);
                }

            }

            $id_product_attribute = $this->getIdProductAttribute();
            parent::canonicalRedirection($this->context->link->getProductLink(
                $this->product,
                null,
                null,
                null,
                null,
                null,
                $id_product_attribute
            ));
        }
    }


If you still have a problem, I would clear the cache.

Hope this helps!

 

I'm wondering what version you made the above change to. We are on 1.6.1.18 and the code that is displayed in the function is completely different.

 

	    public function canonicalRedirection($canonical_url = '')
    {
        if (Tools::getValue('live_edit'))
            return ;
        if (Validate::isLoadedObject($this->product))
            parent::canonicalRedirection($this->context->link->getProductLink($this->product));
    }
	

We were trying to install an upgraded payment module to the Beanstream Payment Gateway. The result seems to be a removal of all combination inventory even though the ps-stock-available table has values for the products.

Thanks,

 

Bastien

Share this post


Link to post
Share on other sites
En 3/11/2018 a las 4:39 PM, zielony_zolw dijo:

After a few hours of searching, only this solution worked

Hi,

I have Prestashop version 1.7.3 and I've tried 2 different solutions:

 

1) Change to YES to the option: Show products with not available attributes in the product page. AND THIS WORKED FOR ME, but it's not a valid solution, because I have a lot of combinations for each product without stock and this is not useful for my customer.

image.png.c32f532f29f25be980ebe23d92be8d2a.png

2) I applied the change in the ProductController.php as explained on this threat and IT'S NOT WORKING FOR ME. (And yest I removed the Caché ;-)

For instance, you can see the issue on this product:

https://deportesasturias.com/hombre/ropa/polares/fairview-polar-regatta-hombre

 

Any clue? Thanks in advance

 

 

 

image.png

Share this post


Link to post
Share on other sites

Hi,

Solved but only with this:

only seo configuration ({category:/}{id}{-:id_product_attribute}-{rewrite}{-:ean13}.html)

Share this post


Link to post
Share on other sites

Using 1.7.4 and this issue is not resolved for me. I've tried every suggestion and fix in the this thread without success.

Anyone using 1.7.4 with working attributes? (specifically two sets of attributes like Size and Colour)

Share this post


Link to post
Share on other sites

Still have this issue as well on 1.7.4.2.

Tried everything suggested here but nothing fixed it.

Anyone has an idea on how to fix it ? This is particularly problematic !

Share this post


Link to post
Share on other sites

Hello,

same problem here -1.7.4.2 generates error 500 in network monitor when switching to combination where available size is not as actually chosen.

[PrestaShopObjectNotFoundException]

Can not retrieve the id_product_attribute
at line 6143 in file classes/Product.php

 

Share this post


Link to post
Share on other sites
On 1/8/2018 at 9:12 AM, Pełny Koszyk said:

Hello,

same problem here -1.7.4.2 generates error 500 in network monitor when switching to combination where available size is not as actually chosen.


[PrestaShopObjectNotFoundException]

Can not retrieve the id_product_attribute
at line 6143 in file classes/Product.php

 

 

 

have you found a solution?

Share this post


Link to post
Share on other sites

I am also having same issue not fixed yet... tried everything in this thread.
For Multiple product variance, only one attribute group displaying, other attributes shows blank option list...


Using : 1.7.2.4

support.png

Edited by Muthu (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites
On 27/07/2018 at 6:55 PM, Pureshore said:

Still have this issue as well on 1.7.4.2.

Tried everything suggested here but nothing fixed it.

Anyone has an idea on how to fix it ? This is particularly problematic !

 

Fyi, I fixed the problem by reinstalling Prestashop 1.7.4.2 eventhough it was the one already installed. Not sure what changed but it now works.

You may want to try a fresh local installation and see if it works: if it does, problem comes from your theme or previous changes and reinstalling Prestashop should work.

Share this post


Link to post
Share on other sites

I have this issue also - similar to what's described here:

http://forge.prestashop.com/browse/BOOM-6113

It looks like it is fixed in version 1.7.5.0  so hopefully that will be released soon.

I tried version 1.7.5.0 and it does indeed fix my issue.

 

I'm fairly new to prestashop and I'm a bit shocked that there should be such a fundamental

problem with the system and they did not patch immediately

Edited by stupidchief (see edit history)

Share this post


Link to post
Share on other sites
On 22.08.2018 at 3:41 PM, lp-wico said:

 

have you found a solution?

For a moment I've added products with appropriate size at quantity 0 to avoid error. Better than nothing. Waiting for official fix.

Share this post


Link to post
Share on other sites

I was running Prestashop 1.7.4.0 and tried to add products with two sets of combinations. Initially everything was working fine. I then noticed that the combinations were suddenly not working anymore and that selecting any of them would be only temporarily for a second before switching automatically back to default. The changes I did before that happened were:

  • install and activate one fo those plugins that creates clean URLs;
  • update the configuration of the SEO friendly URLs in the SEO and URLs backoffice section;
  • Installed a module that allows me to create combinations with virtual products;

I am not sure what caused the combination selection to fail but I figured that if I created those same combinations all in one set instead of two separate sets, I was still able to have a front shop with working combinations. So I deleted the clean URLs module but kept the virtual combinations one. Clean URLs set to friendly again.

Then I updated to Prestashop 1.7.4.2 and the combination selection started to fail again. Because of the update I went through the same three points I went through when it failed in the first place.

  • re-install and activate one fo those plugins that creates clean URLs;
  • update the configuration of the SEO friendly URLs in the SEO and URLs backoffice section;
  • re-installed a module that allows me to create combinations with virtual products;

I have tried all of the suggested solutions mentioned here and none of them has worked:

  • updated the code in ProductController.php as suggested by mailbox@privilegedso;
  • updated the hyphen separating the URLs into a comma and viceversa as suggested by kevinmiao;
  • updated the string generating the product URLs as suggested by Marksaa;
  • associated each combination with a unique picture;

Nothing has worked so far. it's extremely frustrating. I do believe that starting with a fresh install of Prestashop 1.7.4.2 things would go back to normal but it is a lot of work for me and I don't think I will have the time to do it.

Waiting for 1.7.5 but even when that comes out I guess we will have to wait for an update of the 1-click update module which usually takes a little while to catch up with the latest release without causing problems.

Share this post


Link to post
Share on other sites
On 8/31/2017 at 1:51 PM, Marksaa said:

Found solution to this

 

go to SEO and change product url :

 

{category:/}{id}{-:id_product_attribute}-{rewrite}{-:ean13}.html

 

to

 

{category:/}{id}{-:id_product_attribute}-{rewrite}.html

 

save and that's it

 

 

WORKED!! Marksaa you are a life saver thank you very much!

Share this post


Link to post
Share on other sites

Hello all!

I have the same issue and tried every solution posted here and in other forums.

On my website, the URL does not show the attribute. But I checked the SEO & URL and it shows the same {category:/}{id}-{rewrite}{-:ean13}.html as in a clean install of PS 1.6.1.19 where the attributes work properly.

https://www.bijoux-isady.fr/fr/bracelets-gourmettes-a-graver/90903-isady-mery-gold-gourmette-bracelet-a-graver-plaque-or-18k-maille-gourmette-plusieurs-tailles.html

I am out of my mind searching for a solution since already 5 hours! Please help me.

Share this post


Link to post
Share on other sites

The SAME problem here, im suing 1.7.4.3.... its a SAME updating the fucking Prestashop... alwayss new problems for everyone! >:(

 

If you change the SEO URL configuration, thats not a problem? Google...

Edited by RockStar360 (see edit history)

Share this post


Link to post
Share on other sites

Hey folks, we've tested this using the updates on the DEV channel and the issue is fixed. If you can wait for this to become an official release that is...

Share this post


Link to post
Share on other sites

The attribute selection on the FO on prestashop is just so bad. You have to wait for the page to reload before you can choose another attribute, with nothing showing something is working. This is reported by tons of customer. So yes we blame PS.

Edited by digit89 (see edit history)

Share this post


Link to post
Share on other sites

mdekker click here and open your eyes please. I don't understand how you can be a moderator if you don't know the prestashop basis.

 

EDIT : Keep in mind the PS official demo is hosted on a powerful server, not that kind of shared host mister everybody rent.

Edited by digit89 (see edit history)

Share this post


Link to post
Share on other sites

I can't believe it, the moderator mdekker who replied banned my account digit89 and removed his comments. When brainless people got power !

  • Sad 1

Share this post


Link to post
Share on other sites
43 minutes ago, Terramoka said:

Hello, I am on version 1.7.4.2 and i  tried everything here and nothing is working 

For me it was the ProductController from the theme. It was a bad function "getIdProductAttribute".

So you can try: Go to controllers - > front -> ProductController.php and search "function getIdProductAttribute()" 

Mine was bad coding and this is the good one:

/****** Start*****

private function getIdProductAttribute($useGroups = false)
    {
        $requestedIdProductAttribute = (int) Tools::getValue('id_product_attribute');

        if ($useGroups === true) {
            $groups = Tools::getValue('group');

            if (!empty($groups)) {
                $requestedIdProductAttribute = (int) Product::getIdProductAttributesByIdAttributes(
                    $this->product->id,
                    $groups
                );
            }
        }

        if (!Configuration::get('PS_DISP_UNAVAILABLE_ATTR')) {
            $productAttributes = array_filter(
                $this->product->getAttributeCombinations(),
                function ($elem) {
                    return $elem['quantity'] > 0;
                }
            );
            $productAttribute = array_filter(
                $productAttributes,
                function ($elem) use ($requestedIdProductAttribute) {
                    return $elem['id_product_attribute'] == $requestedIdProductAttribute;
                }
            );

            if (empty($productAttribute) && !empty($productAttributes)) {
                return (int)array_shift($productAttributes)['id_product_attribute'];
            }
        }

        return $requestedIdProductAttribute;
    }

/**** End*****

Share this post


Link to post
Share on other sites
1 minute ago, dani said:

For me it was the ProductController from the theme. It was a bad function "getIdProductAttribute".

So you can try: Go to controllers - > front -> ProductController.php and search "function getIdProductAttribute()" 

Mine was bad coding and this is the good one:

/****** Start*****

private function getIdProductAttribute($useGroups = false)
    {
        $requestedIdProductAttribute = (int) Tools::getValue('id_product_attribute');

        if ($useGroups === true) {
            $groups = Tools::getValue('group');

            if (!empty($groups)) {
                $requestedIdProductAttribute = (int) Product::getIdProductAttributesByIdAttributes(
                    $this->product->id,
                    $groups
                );
            }
        }

        if (!Configuration::get('PS_DISP_UNAVAILABLE_ATTR')) {
            $productAttributes = array_filter(
                $this->product->getAttributeCombinations(),
                function ($elem) {
                    return $elem['quantity'] > 0;
                }
            );
            $productAttribute = array_filter(
                $productAttributes,
                function ($elem) use ($requestedIdProductAttribute) {
                    return $elem['id_product_attribute'] == $requestedIdProductAttribute;
                }
            );

            if (empty($productAttribute) && !empty($productAttributes)) {
                return (int)array_shift($productAttributes)['id_product_attribute'];
            }
        }

        return $requestedIdProductAttribute;
    }

/**** End*****

Thanks Dani, I saw on other posts that the issue might also come from attribute seperators in "PS_configuration" table, I suspect my problem originates from there. I will try your fix after and see which one it is. 

Share this post


Link to post
Share on other sites

OK, so actually it is an error with my theme but if i change the Controller code i get error 500, might just get the zen option for a few bucks, as i need this fixed ASAP

Share this post


Link to post
Share on other sites

wow. the developpers of my theme keep saying it's prestashop, but i know for a fact that when i change themes i DO NOT get the errors, i tried everything from changing URL to BO options to making changes to product controller. 
i'm on 1.7.4.2 and dont intend on changing because i'm sure that will break something else

Share this post


Link to post
Share on other sites
On 12/6/2018 at 12:00 PM, Terramoka said:

wow. the developpers of my theme keep saying it's prestashop, but i know for a fact that when i change themes i DO NOT get the errors, i tried everything from changing URL to BO options to making changes to product controller. 
i'm on 1.7.4.2 and dont intend on changing because i'm sure that will break something else

Can you try adding the core files (from the theme) manually, one by one and maybe see which one is causing the conflict?

Share this post


Link to post
Share on other sites
56 minutes ago, dani said:

Can you try adding the core files (from the theme) manually, one by one and maybe see which one is causing the conflict?

I was actually generating the combinations, works well now 

Share this post


Link to post
Share on other sites
On 5/30/2017 at 4:16 PM, quochuy said:

I'm getting this same issue with PS 1.7.1.1 and setting "separate attributes anchor" to "-" didn't work for me.

For me worked by setting "," instead of "-"

PS 1.7.5

Share this post


Link to post
Share on other sites

same problem, how to resolve, tried different method posted but no one worked for me.

Share this post


Link to post
Share on other sites

Hi everybody:

I had similar issues using combinations, mostly using colors as attributte. I solved all by doing this simple thing in PS 1.7.4 (it could help)

In catalogue > list of attributes  have several attributes, including color, size and paper type. I reorder the attributtes, and put color in the LAST position: it works for me! In other position, the colors thrown an ajax error always, i felt confussed about this... but this solved it

Share this post


Link to post
Share on other sites
Posted (edited)
On 1/10/2019 at 6:29 PM, undesigned said:

For me worked by setting "," instead of "-"

PS 1.7.5

We’ve made an upgrade to 1.7.5.1 and it’s the same problem :(
- multishop activated
 

On 1.7.5 was solved with solution mentionated above.
But now thoesn`t work

I can’t make a downgrade because on the oldest version products combinations was very slow on editing.

Any solutions / opinions please?

Edited by undesigned (see edit history)

Share this post


Link to post
Share on other sites

ok guys,

So i was having the same problem after the upgrade to version 1.7.5.1. previously i had version 1.7.3.2 and i didn't have the problem

I figured that the problem was caused by an outdated override file ProductController.php on -> override/controllers/front

The module i'm using is Ps IT Clean url's. i had it installed first with the version 1.7.3.1 and at that time the module created the override.

since that version of the module was not compatible with the latest version of prestashop, i purchased the newer version and installed it again.

-> the problem was... it didn't update the override file. so the file that stayed was the old one which wasn't compatible, and caused the problem of not allowing me to change the attribute of any products.

To solve the problem i only had to overwrite the old ProductController.php on -> override/controllers/front with the new one that comes with the module .zip file.

i was only able to get to this result because i created a localhost store and everything was working there. even after my main store and back-up/test site were having problems. since the installation on localhost was already the latest, i started opening all the files in dreamweaver to check the differences. when i say a differnt version number inside, i knew that was the problem.

 

Anyway, i hope this will help any of you get the problem solved. Just thought i would give back to this comunity that has helped out a lot in the past already.

Share this post


Link to post
Share on other sites
On 10/26/2017 at 3:02 PM, mailbox@privilegedso said:

public function canonicalRedirection($canonical_url = '')     {         if (Validate::isLoadedObject($this->product)) {             $check = Product::getDefaultAttribute($this->product->id); // Does it have any attributes / combinations?             if($check === 0) {                 unset($_GET['id_product_attribute']);             } else {                 // id_product_attribute will be set in the url                                  if(!isset($_GET['id_product_attribute'])) { // if not set in url, get the default value                     $_GET['id_product_attribute'] = Product::getDefaultAttribute($this->product->id);                 }             }             $id_product_attribute = $this->getIdProductAttribute();             parent::canonicalRedirection($this->context->link->getProductLink(                 $this->product,                 null,                 null,                 null,                 null,                 null,                 $id_product_attribute             ));         }     }

 

Share this post


Link to post
Share on other sites

Hello,

For the problem of update combination in prestashop 1.7.4, the problem reproduced if  product have a section of related products.

you can just remove the list of related product and the update combination will work, for my case I did some change by code to resolve the problem with section related products

Share this post


Link to post
Share on other sites
On 8/24/2018 at 4:45 PM, Muthu said:

I am also having same issue not fixed yet... tried everything in this thread.
For Multiple product variance, only one attribute group displaying, other attributes shows blank option list...


Using : 1.7.2.4

support.png

Facing the same error in Ps 1.7.2.

Hey, @Muthu Have you solved this error?

Please help me if you did.

Thanks & regards,

Himanshu

 

 

Share this post


Link to post
Share on other sites

Hi there.

If anyone don't want to waste his time with all this. The only thing that works form me was editing the url of product like {id:/}{-:id_product_attribute}{rewrite}.html 

It's important keep the order.

1. ID

2. ID PRODUCT ATTRIBUTE

3. REWRITE

 

schema-of-urls.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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