he product doesn't have a store id associated with it - remember to add the Tea Commerce store picker to your Umbraco content tree
Hi,
I'm hitting an issue with TC!
When viewing the basket its saying that i dont have a store ID associated with the product... The store ID is set at the highest node (in this case the homepage) This worked previous but has stopped working!
The error im getting is:
Code:
@using TeaCommerce.Api.Models
@using TeaCommerce.Umbraco.Web
@inherits UmbracoTemplatePage
@{
Layout = "MasterCartStep.cshtml";
IPublishedContent currentPage = Model.Content;
IPublishedContent nextStep = currentPage.Children.FirstOrDefault();
long storeId = long.Parse(currentPage.GetPropertyValue<string>("store", true));
Order order = TC.GetCurrentOrder(storeId, false);
if (order != null && order.OrderLines.Any()){
if (Convert.ToInt32(order.SubtotalPrice.Value.Value) >= 1000)
{
var shipMethods = TC.GetShippingMethods(storeId).ToList();
if (shipMethods.Count() > 0)
{
TC.SetCurrentShippingMethod(storeId, shipMethods[0].Id);
}
}
else
{
var shipMethods = TC.GetShippingMethods(storeId).ToList();
if (shipMethods.Count() > 0)
{
TC.SetCurrentShippingMethod(storeId, shipMethods[1].Id);
}
}
}
}
I have tired unsetting the store in the store picker and then resetting, I have tried republishing all pages but both haven't worked.
Could any point help me out? The website is supposed to be going live in 2 weeks and this is 100% going to prevent this happening!
I have gone into the country under Internationalization > Countires> United Kingdom (which is the only country set) and ensured that default shipping method and default payment method are set. The issue still persists...
Check the "SETTINGS" node, and double check you have UK, as your default country, and that all the other shipping methods, and currencies, payment methods are available for your default Country.
One issue I discovered today was that TC.GetPrice fails on product nodes which are not published. This is normally not a problem since you should never encounter unpublished product nodes on a live site, but in your local/dev environment, if you are previewing a node (any node), then the Umbraco navigation methods (e.g. Content.Children()) will include unpublished nodes. At that point you may run into the problem.
My work around is to wrap TC.GetPrice in a helper method, and return null (instead of allowing it to throw an exception) if product.IsDraft is true.
he product doesn't have a store id associated with it - remember to add the Tea Commerce store picker to your Umbraco content tree
Hi,
I'm hitting an issue with TC!
When viewing the basket its saying that i dont have a store ID associated with the product... The store ID is set at the highest node (in this case the homepage) This worked previous but has stopped working!
The error im getting is:
Code:
I have tired unsetting the store in the store picker and then resetting, I have tried republishing all pages but both haven't worked.
Could any point help me out? The website is supposed to be going live in 2 weeks and this is 100% going to prevent this happening!
Thanks, Lewis
Have a look in your TC backoffice and ensure you have a default shipping method set, for the default country/region you have set.
I have gone into the country under Internationalization > Countires> United Kingdom (which is the only country set) and ensured that default shipping method and default payment method are set. The issue still persists...
Simplify back your code, and just have it spit out the current storeID value.
You should then be able to workout where things are going wonky.
If its returning the correct storeID, then you know for certain that bits OK, and the problem resides in something else.
I seem to remember, you need to ensure that a default country/currency/shipping method, need to be set. Otherwise things can go a bit wonky.
The correct store id is being returned, I only have one store set so this is and always will be 1.
Here is how the defaults for the store look, all set correctly i believe!
Region code should be "GB" - but not that that should be causing much trouble
This has been updated. This was updated on the UAT version but not DEV. Thanks!
Check the "SETTINGS" node, and double check you have UK, as your default country, and that all the other shipping methods, and currencies, payment methods are available for your default Country.
All checked the default country is set to the United Kingdom and all the methods are available to the UK.
Not working still though!
One issue I discovered today was that TC.GetPrice fails on product nodes which are not published. This is normally not a problem since you should never encounter unpublished product nodes on a live site, but in your local/dev environment, if you are previewing a node (any node), then the Umbraco navigation methods (e.g. Content.Children()) will include unpublished nodes. At that point you may run into the problem.
My work around is to wrap TC.GetPrice in a helper method, and return null (instead of allowing it to throw an exception) if product.IsDraft is true.
I forgot to mention that the exception thrown by TC.GetPrice was the same as the one thrown by the TC.SetCurrentShippingMethod as shown by the OP.
Fell foul to this ole problem again.
Ensure the TeaCommerce Store Picker, has a property alias of "store" (as per the demo website), and not "storeId"
That seemed to fix it for me
is working on a reply...