Jump to content

Possible bug in multistore stock sharing


Recommended Posts

Hi,

 

I'm testing the multistore capabilities of Prestashop and I'm afraid I've come across with a bug in its stock system.

 

This is what I've noticed:

 

- I have two shop groups: "Default" (1) and "Pruebas" (2).

 

- Group 1 has one store (1) and group 2 has two stores (2,3)

 

- Both groups have the "Share available quantities to sell" option marked.

 

- I have a product which is shared by all the stores/groups

 

- On the "Quantities" option of this product edit screen I selected the "Pruebas" group and set the quantity to 10. I saved it with success. I can see those 10 units when returning to this window.

 

- Later, I selected the "Default" group and set the quantity to 15. I saved it with success but, and there is the problem, when I return to the window the quantity is still 0. And, of course, the product is out of stock on shop 1.

 

I've retried the last step several times with no success.

 

I think the problem must be an unique key (product_sqlstock) on the "ps_stock_available" table which does not include the id_shop_group column so the system cannot insert more than a row for a product.

 

I've been looking on the forum but I haven't found anything about this problem. I would be grateful if someone would show me a workaround for this problem.

 

Greetings from Spain.

Juan María.

 

EDIT:

I've finally tried to modify this index by adding the id_shop_group column to it and now it works like a charm.

Anyway, I'm not happy having modified the database structure by myself, so I'd be grateful if someone would confirm me that this change is acceptable.

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

As far as I understood they did not design multishop to share quantities over different shop groups. If you managed to do that than the only bug is that prestashop did not throw an error e.g. disallowed that. The multishop part is relatively new and I think although we are heading in the right direction I would proceed with care. Problem with you approach is that it might work today but when they change something in the future you might run into trouble.

Link to comment
Share on other sites

As far as I understood they did not design multishop to share quantities over different shop groups.

 

Well, in fact I didn't try to share quantities over different shop groups. I wanted to have one group with 10 units and other with 15 units.

 

The problem with this bug is that you can only enter stock quantities on one group. If you have more groups defined with quantity share you won't be able to set quantities on them.

 

You can have one group with stock sharing and more groups without it, in this case it works ok because PS saves the shop number on the index, but with stock sharing it saves "0" which makes impossible to have more than a row for a product.

 

Greetings from Spain.

Juan María.

Link to comment
Share on other sites

Sorry than I don't get your point. You say

- I have a product which is shared by all the stores/groups
and
Well, in fact I didn't try to share quantities over different shop groups.
. This sounds paradox to me ;)
Link to comment
Share on other sites

Sorry than I don't get your point. You say

and

. This sounds paradox to me ;)

 

Hi again,

 

It's really not a paradox, as far as I can see it, in PS multistore mode you can share the products and you can share, or not, the stock availiable.

 

I've made tests of shops sharing products and having different stocks and it worked fine. I've also made tests sharing stock among shop group and it worked fine as long as you have only one of such groups.

 

Greetings from Spain.

Juan María.

Link to comment
Share on other sites

Yepp and I told you you can not share products over different shop groups. If you want to do that you have to make a new product in let's say group b. The sense of the shop grouping is in fact that they do not interfere with each other. You can have different staff assigned to each shop group and therefore it will lead to chaos when staff from group a can change the quantities from group b. The fact that you can access all groups as superadmin and change quantities in all groups is because you have superpowers. But the concept of the shop groups is to have totally sepereated shop instances. What you want todo is not the way they designed the part.

Link to comment
Share on other sites

Well, you told me not to share quantities, not products. Anyway, I see you point, and I really don't need several shop groups -yet- so I'm going to revert my changes and stick with only one group sharing stock.

 

This said, I insist that there is a bug. If the system does not support having two shop groups sharing the same products with different stocks, it should not allow you doing so, the same way it doesn't allow you editing some fields when in "All shops" mode.

 

Greetings from Spain.

Juan María.

Link to comment
Share on other sites

Ok, I've played a little around with that and I see that it is possible as superadmin to assign a product from group a to group b and I think that should not be possible as it really causes a lot problems. I've change a some parameters in group a and I could accidentally delete the quantities from group b. Maybe in future versions they will catch such cases like assingning products under different groups as impossible but I know from my various bug reports that the multishop part was not highest priority in the past but as the 1.5.X branch is slowly evolving maybe that have more time to make that part more solid too.

Best regards, Trip

Link to comment
Share on other sites

I second that. I should not be allowed to do so and therefore my first advice.. don't do it or when they fix that part you have a lot of trouble with your setup ;) All the best, trip

 

Yep, that's what I'm going to do :)

 

BTW, do you know if this is the appropriate place for reporting a bug?.

 

Greetings from Spain.

Juan María.

Link to comment
Share on other sites

×
×
  • Create New...