Prestashop: [BOOM-4155] CLONE - Registration of price while using multistore

Created on 22 Aug 2018  ·  14Comments  ·  Source: PrestaShop/PrestaShop

This issue has been migrated from the Forge. Read the original ticket here.

  • _Reporter:_ salma.moakhar
  • _Created at:_ Thu, 26 Oct 2017 12:33:26 +0200

If you modify a price in a shop context the price is correctly registered. The price will be different on each shop. But if you would like to modify an other information, shipping for exemple, on the same product in the context All Shops the price will be updated for all shop. The final price will be the price of the default shop.

1.7.2.4 1.7.4.0 1.7.4.1 BO Bug Major Multistore Products TBS

All 14 comments

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ marion_francois
  • _Created at:_ Tue, 26 Dec 2017 10:23:31 +0100

En version 1.6 dans le contexte "all shops", il y avait des checkbox afin de sélectionner les élements à modifier pour toutes les boutiques.
Il y avait également un bouton "Multiboutique Oui/Non" permettant de sélectionner/déselectionner toutes les checkbox.

Ce n'est plus le cas en 1.7, il faut donc remettre les checkbox comme en 1.6

Tristan Lehot on pourra voir la partie design ensemble

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ salma.moakhar
  • _Created at:_ Tue, 26 Dec 2017 10:41:30 +0100

Hi Marion,

D'accord merci

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ marion_francois
  • _Created at:_ Wed, 27 Dec 2017 11:39:12 +0100

Voici la liste des champs devant avoir une checkbox dans le contexte 'all shops"

  • Nom
  • En ligne / Hors ligne

Onglet "Essentiel" :

  • Récapitulatif
  • Description
  • Prix HT
  • Prix TTC
  • Règle de taxe
  • Catégories associées (si possible au niveau de l'affichage)
  • Catégorie principale (si possible au niveau de l'affichage)

Onglet "Quantités" (dans le cas d'un produit standard):

  • Quantité minimale pour la vente
  • Libellé si en stock
  • Si rupture de stock (et précommande autorisée)
  • Date de disponibilité

Onglet "Déclinaisons" (dans le cas d'un produit avec décli):

Sur la liste des déclinaisons:

  • Impact sur le prix

Sur la liste des déclinaisons lors d'un bulk action:

  • Prix d'achat
  • Impact sur le poids
  • Impact sur le prix (HT)
  • Impace sur le prix (TTC)
  • Date de disponibilité
  • Quantité minimale

Sur la page d'édition d'une déclinaison:

  • Date de disponibilité
  • Qté minimale à la vente
  • Prix d'achat
  • Impact sur le prix (HT)
  • Impact sur le prix (TTC)
  • Impact sur le prix unitaire (HT)
  • Impact sur le poids

Onglet "Prix":

  • Montant HT
  • Montant TTC
  • Règle de taxe
  • Prix unitaire (HT)
  • Afficher un bandeau "Promo"
  • Prix d'achat montant HT
  • Le dropdown pour sélectionner la boutique lors de l'ajout d'un prix spécifique est manquant

      

Onglet "Référencement":

  • Balise titre
  • Meta description
  • URL simplifiée

Onglet "Options":

  • Où le produit doit-il apparaitre
  • Disponible à la vente
  • Exclusivité web
  • Etat
  • Personnalisation: libellé, type, requis

 

Hello guys !
Any visibility about this bug ? It's a major one for me, as my second shop prices are modified everytime I change a single word on the product..
If I can help on something, let me know !

Thanks in advance

Hi @elmanu13,

Sorry not yet.
We have a lot to do to fix multistore issues.
Thanks!

Hi,
any good news about this ticket? We haven't find some news in new releases and so I don't know if it's fixed

Thanks

Hi @lorenzoelwood,

Sorry not yet.

Thanks!

Any news?? This is a major problem when working in multistore...

@khouloudbelguith is anyone working on this as far as you know? It's a real problem as I have different prices on all shops.

Hi @wzzly,

Sorry not yet.
There are some major issues to solve before this one.
But PrestaShop is an open-source project, so it can be solved before if someone submits a pull request to solve it.

Thanks!

Hi @wzzly , In All Shops settings when you edit products, all prices are updated for All Shops.
We also marked this as a bug. Because this is stupid behavior. The temporary fix can you find here :

When you are in All shops context Prestashop process edition as you where editing in all shops at the same time.
price and whosale_price are shop's associated fields. So, if you are in All shops context you are editing this values for all shops too.

You can avoid this with the following code. But take into account that with this code if you want to update prices in all shops at the same time, you won't be abble to do it. You will have to update prices only in Single/Specific shop context.

if (Shop::getContext() != Shop::CONTEXT_SHOP)
{
    unset($fields['price']);
    unset($fields['wholesale_price']);
}

This code should be inserted in getFieldsShop() function inside Product class located in \classes\Product.php just before return $fields;

What this code do is telling to Product class that when you are in a Shop context diferent than Single/Specific shop context you won't update prices fields in multishops.
Source: https://stackoverflow.com/questions/40867954/prestashop-multistore-local-store-prices-are-overwritten-with-price-from-defau

In my case the shops use different tax rules, which are also updated in multishop context, so I have added the key to @sdwebdesign temporary fix,

Also, this temporary fix should be done though an override (/overrides/classes/Product.php), so my override looks like this:

` public function getFieldsShop()
{
$fields = parent::getFieldsShop();

    if (Shop::getContext() != Shop::CONTEXT_SHOP) {
        unset($fields['price']);
        unset($fields['wholesale_price']);
        unset($fields['id_tax_rules_group']);
    }

    return $fields;
}`

Hi guys,
thank you very much for the fix. It works fine on my 1.7.6.x. But do you have any idea, how to stop saving wholesale price per each combination?

When I have different wholesale price for each combination, it's always overwritten by default shop price, when I save the product in All Shop mode.

Thank you for your help

@JanHavlicek you can edit the admin product controller in the symfony src folder /src/PrestaShopBundle/Controller/Admin/ProductController.php.

In the formAction method you can unset the $_POST['combinations'] superglobal depending on the shop context. Around line 540

// check shop context here
if (Shop::getContext() != Shop::CONTEXT_SHOP) {
    unset($_POST['combinations']);
} else {
    foreach ($_POST['combinations'] as $combinationValues) {
        $adminProductWrapper->processProductAttribute($product, $combinationValues);
         // For now, each attribute set the same value.
         $adminProductWrapper->processDependsOnStock(
             $product,
             ($_POST['depends_on_stock'] == '1'),
              $combinationValues['id_product_attribute']
          );
     }
}

You will also need to include the Shop class at the top of the file:
use Shop;

Obviously I would advise against doing this as it is a core file change, the functionality is not being added via a hook or override.

Hope this helps.

Was this page helpful?
0 / 5 - 0 ratings