Jump to content

PS 1.7.0.6 product attributes not showing in admin product page


PeterVajda

Recommended Posts

Okay, I discovered the cause.

 

Attributes column in administration disappears when I delete one of languages (Czech and Slovak languages are both installed at one time). When Czech is deleted, attributes column disappear.

 

I strongly suggest solving this in next PS 1.7 release.

Link to comment
Share on other sites

Solution for this problem 

open in /src/PrestaShopBundle/Controller/Admin/ProductController.php 
 $attributeGroups = $this
            ->getDoctrine()
            ->getManager()
            ->getRepository('PrestaShopBundle:Attribute')
            ->findByLangAndShop(1, 1);
 
 
set in FindByLangAndShop(you language id, you shop id)
  • Like 3
  • Thanks 2
Link to comment
Share on other sites

  • 3 months later...

 

Solution for this problem 

open in /src/PrestaShopBundle/Controller/Admin/ProductController.php 
 $attributeGroups = $this
            ->getDoctrine()
            ->getManager()
            ->getRepository('PrestaShopBundle:Attribute')
            ->findByLangAndShop(1, 1);
 
 
set in FindByLangAndShop(you language id, you shop id)

 

Excelent!!

Link to comment
Share on other sites

  • 2 months later...

 

Solution for this problem 

open in /src/PrestaShopBundle/Controller/Admin/ProductController.php 
 $attributeGroups = $this
            ->getDoctrine()
            ->getManager()
            ->getRepository('PrestaShopBundle:Attribute')
            ->findByLangAndShop(1, 1);
 
 
set in FindByLangAndShop(you language id, you shop id)

 

 

Sir, you are my hero, problem solved

Link to comment
Share on other sites

  • 1 month later...
13 hours ago, homeuk said:

This works for me but I have to do it every time there is a minor update performed. Is there any way to stop this happening?

In this last line FindByLangAndShop (1, 1); edit the first number of the parentheses, changing to the default language ID. To find out what the default language ID is, go to the INTERNATIONAL - LOCATION - LANGUAGES menu, and to the left of the default language flag you can see the ID column. In my case, the default language ID for English is 2. So I changed the line to the following:
-> findByLangAndShop (2, 1);

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 3 months later...
  • 3 weeks later...
  • 8 months later...

Hi, 

May I seek for your help that I can't edit the products when I have multistore condition of 1.7.2.1

the log messages: 

Matched route "admin_product_form".Context: { "route_parameters": {"_controller": "PrestaShopBundle\\Controller\\Admin\\ProductController::formAction", "_legacy_controller": "AdminProducts", "_legacy_param_mapper_class": "PrestaShop\\PrestaShop\\Adapter\\Product\\AdminProductDataProvider", "_legacy_param_mapper_method": "mapLegacyParametersProductForm", "id": "2416", "_route": "admin_product_form" },"request_uri": "https://amieetcopain.com/kids/index.php/product/form/2416?_token=XWVBiLwteZtIH3HubBbingZ8rUthNfeZGZ3U783OfyY" }

Hope that you could help.

 

Thank you 

Link to comment
Share on other sites

On 3/30/2017 at 2:41 AM, cherepaxa said:

Solution for this problem 

open in /src/PrestaShopBundle/Controller/Admin/ProductController.php 
 $attributeGroups = $this
            ->getDoctrine()
            ->getManager()
            ->getRepository('PrestaShopBundle:Attribute')
            ->findByLangAndShop(1, 1);
 
 
set in FindByLangAndShop(you language id, you shop id)

Sorry I cam't find "findByLangAndShop" in my php file, may I know how to find it?

Thank you

Link to comment
Share on other sites

On 1/29/2019 at 3:38 PM, amieetcopain said:

Sorry I cam't find "findByLangAndShop" in my php file, may I know how to find it?

Thank you

Are you using which version of prestashop?

You can find it in prestashop version 1.7.5 at approx line 612
$doctrine = $this->getDoctrine()->getManager();
        $attributeGroups = $doctrine->getRepository('PrestaShopBundle:Attribute')->findByLangAndShop(1, 1);

$doctrine = $this->getDoctrine()->getManager();
$attributeGroups = $doctrine->getRepository('PrestaShopBundle:Attribute')->findByLangAndShop(1, 1);

Just replace it with
 

$doctrine = $this->getDoctrine()->getManager();
$attributeGroups = $doctrine->getRepository('PrestaShopBundle:Attribute')->findByLangAndShop(you language id, you shop id);

 

I hope it will be helpful for you.

Link to comment
Share on other sites

1 hour ago, ican said:

Are you using which version of prestashop?

You can find it in prestashop version 1.7.5 at approx line 612
$doctrine = $this->getDoctrine()->getManager();
        $attributeGroups = $doctrine->getRepository('PrestaShopBundle:Attribute')->findByLangAndShop(1, 1);


$doctrine = $this->getDoctrine()->getManager();
$attributeGroups = $doctrine->getRepository('PrestaShopBundle:Attribute')->findByLangAndShop(1, 1);

Just replace it with
 


$doctrine = $this->getDoctrine()->getManager();
$attributeGroups = $doctrine->getRepository('PrestaShopBundle:Attribute')->findByLangAndShop(you language id, you shop id);

 

I hope it will be helpful for you.

Thanks for your reply. I'm using prestashop 1.7.2.1 

Now, I can login the admin panel and can update the products, but I can't edit the configure of modules.....

 

Link to comment
Share on other sites

40 minutes ago, amieetcopain said:

Thanks for your reply. I'm using prestashop 1.7.2.1 

Now, I can login the admin panel and can update the products, but I can't edit the configure of modules.....

 

 

What's the exact issue with configure of modules?

Link to comment
Share on other sites

On 3/29/2017 at 8:41 PM, cherepaxa said:

Solution for this problem 

open in /src/PrestaShopBundle/Controller/Admin/ProductController.php 
 $attributeGroups = $this
            ->getDoctrine()
            ->getManager()
            ->getRepository('PrestaShopBundle:Attribute')
            ->findByLangAndShop(1, 1);
 
 
set in FindByLangAndShop(you language id, you shop id)

Thank you So much!
This solution resolved my problem :)

Edited by fazfaz (see edit history)
Link to comment
Share on other sites

  • 2 months later...

Hello

 

in my PHP File is that correct:

$attributeGroups = $this
            ->getDoctrine()
            ->getManager()
            ->getRepository('PrestaShopBundle:Attribute')
            ->findByLangAndShop(1, 1);

the language ID is 1: 

image.thumb.png.0b22cabf3bb10f2d2cf7e80639c2fea2.png

 

i can't not see the variants / combination on the right side:

image.thumb.png.354d596ccc2247e253621493e7bc67a7.png

my PrestaShop-Version is 1.7.3.0. Is not possible to update, I have purchased modules that run on this version.

 

i hope somebody has any idea to solve this problem.

 

Link to comment
Share on other sites

  • 2 months later...
5 hours ago, Dan1 said:

Any solution for this in 1.7.6?

I'm on 1.7.5.2 but I can't see it making much difference - the above fix where you edit that line of code worked for me two weeks ago.
Just need to keep editing it every time it upgrades which is a pain but easy once you've done it a few times

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

I had the same problem and have solved by changing my id_shop in AttributeRepository.php.

When I installed my theme, it created one id_shop to each theme variation, and i have chosen the id_shop 6 to production. My ps_shop table has just one entry, with id_shop = 6.

When i debug the ProductController.php, i saw that $id_shop var was always null, and the function findByLangAndShop() was returning nothing. So, I edited the function in the file /src/PrestaShopBundle/Entity/Repository/AttributeRepository.php

I Changed:

->setParameters([
                'idShop' => $idShop,
                'idLang' => $idLang,
            ]);

to:

->setParameters([
                'idShop' => 6,
                'idLang' => $idLang,
            ]);

I think this is a bug in core prestashop files.

Edited by fredecs (see edit history)
Link to comment
Share on other sites

  • 2 years later...

Sorry to revieve an old thread, but Prestashop V8 is also having this issue. I can't see attributes when only one language exists. Has anyone managed to fix this on the lastest version?

Link to comment
Share on other sites

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...