Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product wholesale_price update #31830

Open
2 tasks done
George-Cara opened this issue Mar 17, 2023 · 2 comments
Open
2 tasks done

Product wholesale_price update #31830

George-Cara opened this issue Mar 17, 2023 · 2 comments
Labels
8.0.1 Affects versions Bug Type: Bug CO Category: Core Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Old Products Page Concerns the old product page Ready Status: Issue is ready to be worked on Verified The issue has been reproduced

Comments

@George-Cara
Copy link

Prerequisites

Describe the bug and add attachments

When changing the product wholesale price on product page (no matter what shop you're in) the wholesale_price column of ps_product table will be set to 0. The value is updated only in ps_product_shop.

Expected behavior

The wholesale_price should be updated in ps_products as well

Steps to reproduce

  1. Go to a product page and update the wholesale price.
  2. Go to ps_product table in your database and you will see wholesale_price set to 0
  3. Alos check wholesale_price in ps_product_shop and you will see it modified as expected

PrestaShop version(s) where the bug happened

8.0.2

PHP version(s) where the bug happened

7.4

If your bug is related to a module, specify its name and its version

No response

@George-Cara George-Cara added Bug Type: Bug New New issue not yet processed by QA labels Mar 17, 2023
@AureRita
Copy link
Contributor

Hi @George-Cara ,

I reproduce the issue with PrestaShop versionn 8.0.1, as you can see :

Untitled_.Mar.23.2023.4_55.PM.webm

I'll add this to the backlog so it can be fixed.

Please be aware that some issues might take a very long time to be resolved. If this one is important to you and you cannot wait for it to be fixed on the project’s own time, we strongly suggest you consider contacting a professional to help you.

If you fix the issue on your end, please contribute it back to the project. Remember that the more people contribute, the better PrestaShop becomes for everyone.

Thanks

@AureRita AureRita added CO Category: Core Old Products Page Concerns the old product page Ready Status: Issue is ready to be worked on Verified The issue has been reproduced 8.0.1 Affects versions Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification and removed New New issue not yet processed by QA labels Mar 23, 2023
@clotairer
Copy link
Contributor

Sample workarround

    public function hookActionObjectCombinationUpdateAfter($params)
    {
        /** @var \Combination $combination */
        $combination = $params['object'];
        $product = new \Product($combination->id_product);

        $sql = 'UPDATE `' . _DB_PREFIX_ . 'product` ' .
            'SET ' .
            'wholesale_price = "%s" ' .
            'WHERE id_product = %d';

        \Db::getInstance()->execute(
            sprintf(
                $sql,
                pSQL($product->wholesale_price),
                $product->id
            )
        );
    }

Tricky to fix with a Pull Request.
In fact, there is a conflict with wholesale_price set to 0 by wholesale_price by supplier in the option tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.0.1 Affects versions Bug Type: Bug CO Category: Core Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Old Products Page Concerns the old product page Ready Status: Issue is ready to be worked on Verified The issue has been reproduced
Projects
None yet
Development

No branches or pull requests

3 participants