Getting store in block #531
-
Hi I have a few stores, so far working nicely. I want to add a block but to be reusable for all stores. At the moment when I try to retrieve store I can't use Model.Value. if I use CommerceApi.GetStore("store"); I think it doesn't look up the tree to get the store so returns null. I don't want to hard code the store name as I want the control to be used for multiple stores. How do I get a store in a block? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You probably need to look at getting the parent node for the block and then look the store up from there. I'm not sure the API for looking up a blocks parent though, but hopefully it guides you in the right direction. |
Beta Was this translation helpful? Give feedback.
You probably need to look at getting the parent node for the block and then look the store up from there. I'm not sure the API for looking up a blocks parent though, but hopefully it guides you in the right direction.