Close

Profile: hristian.dimov

Avatar

User posts

Custom Rules
10 years ago

nicolasmuniere wrote:
Hi, I have two questions :

- Is it possible to implement a custom rule in app_code folder? I would like to avoid creating a plugin just for that.

- Could you provide the linq query that is used in UnpaidOrdersReminderRule, because I need to create UnpaidByCheckOrdersReminderRule and I'm not able to start the query.

Thanks
Nicolas


Hi Nicolas,

You can implement a rule without creating a plugin, but you will need to register you rule in some DependencyRegistrar file.

Example:

builder.RegisterType<UnpaidByCheckOrdersReminderRule>().As<IReminderRule>().InstancePerLifetimeScope();


About the UnpaidOrdersReminderRule query, please submit a ticket.

NADIELY wrote:
Sometimes I got this error in LOG.

Filters appear to work. I dont know if works when error occurs.

Can you help?

System.InvalidOperationException: The JSON request was too large to be deserialized.


Hi Nadiely,

Please refer to this post for the fix.

Custom Rules
10 years ago

IvanSlater wrote:
Thanks!

Last question.

Do I have to set an exclusive Guid for the Id property or I can use return new Guid() ?


You can use the visual studio built-in tool for creating a new GUID. Just go to Tools -> Create Guid.

It will generate you a GUID, which you can place it in the constructor, example:

public Guid Id
{
  get
  {
    return new Guid("3BF7F2D0-2907-4CBA-8A51-57576D490F60"); // you can replace it with your generated guid
  }
}

Custom Rules
10 years ago

IvanSlater wrote:
Hi Hristian,

thanks a lot. Do you have a simple sample? I need to create another plugin, a "rule plugin", is it right?

EDIT:

I have created a new plugin with all my new rules. Now, can you say more about both interface methods:

- GetAllowedTokens
- GetCustomerReminderInfos

I guess they are called at each task call, am I right? The CustomerReminderInfo list returned are all items that will received the message?

And about the tokens, if I create a new one, where it have to be replaced? Or is not possible to have new ones?


Thanks!


Yes, you can done it with a plugin.

Example of The CustomerReminderInfos method:

public IList<CustomerReminderInfo> GetCustomerReminderInfos(TimeSpan conditionMetDataEarlierThan, TimeSpan conditionMetDateLaterThan, int storeId)
{  
  var customerReminderInfos = new List<CustomerReminderInfo>();

  //perform your logic for selecting the data that you need
  IList<global::Nop.Core.Domain.Customers.Customer> inactiveCustomers = GetInactiveCustomers(conditionMetDataEarlierThan, conditionMetDateLaterThan);

  foreach(var customer in inactiveCustomers)
  {
    var customerReminderInfo = new CustomerReminderInfo()
                     {
                       Customer = customer,
                       ReminderMessageId = customer.Id,
                       RuleConditionMetDate = customer.CreatedOnUtc,
                       Tokens = GetTokens(customer), // or you can leave it as "new List<Token>()"
                       StoreId = storeId
                     };

    customerReminderInfos.Add(customerReminderInfo);
  }

  return customerReminderInfos;
}

private IList<Token> GetTokens(Customer customer)
{
  var tokens = new List<Token>();

  tokens.Add(new Token("Customer.FullName", customer.GetFullName()));

  return tokens;
}


and yes, you can create new tokens, but you must evaluate them in the GetTokens method, just like the example above.

GetAllowedTokens method example:

public IList<string> GetAllowedTokens()
{
  var allowedTokens = new List<string>()
              {
                "%Customer.FullName%"
              };

  return allowedTokens;
}


Hope this helps!

Bugs
10 years ago

Meredith88 wrote:
Hi,

I have an issue when I have 2 or more different items in the cart.  When I try remove any of the products other than the top product nothing happens.  Any guidance on this issue would be much appreciated.

Edit: Forgot to mention this is in version 3.4

Thanks in advance,

James


Hi James,

can you reproduce this on our demo site http://themes.lighthouse.nop-templates.com/ ?

If not can you please update the theme to the latest version following this article: http://www.nop-templates.com/how-to-update-a-nopcommerce-theme

10 years ago

ron.richardson wrote:
I would like to see another option for COndition Type for Topics.  I'd like to put a widget zone on the generic topics view, but be able to show different content in that widget zone on each page.

For example, on topic page A, show one image in the widget zone, but on topic page B show a different image in the same widget zone.


Hi Ron,

thank you for your feedback !

Please suggest this idea to our uservoice portal and we might consider adding it in the future releases of the plugin.

10 years ago

C.A.LL wrote:
Hi,

I have installed the plugin parameters with google ecommerce me but does not reflect sales paid by PayPal or TPV-Sermepa in analytics. Do you know why this might happen? That's the theme or plugin settings.

Thanks


I'm not sure what could cause the problem, because we don't have the source code of the plugin and therefore we cannot advice you. You need to contact the plugin vendor for more information about it.

Custom Rules
10 years ago

IvanSlater wrote:
Hi there!

Is possible to create custom rules?

I want to schedule mails for some especifics situations based on procuts, shipments and others attributes.

Thanks!


Hi IvanSlater,

Yes, it is possible to create a custom reminder rules.

Basically, you just need to implement the IReminderRule inferface.

When you do this, your rule will appear in the reminder rule dropdown in the administration.

Hope this helps!

ehubcap wrote:
Hi support, I stumbled upon this error at my website http://ehubcap.net/ order detail page while I was running a dry test.
I got it also replicated at the demo page, see it here:
http://themes.traction.nop-templates.com/orderdetails/7.
Could you please tell me the fastest way to find the error and fix it?.
I spent some time chasing it around, but I realize that you guys will find in a snap, rather than me wasting time trying to filter it out.
Also there is a lot of logged errors 10000+ that are being generated due a missing reference like this one:
"(Resource string (sevenspikes.themes.nitro.common.itemboxcomparebutton) is not found Language ID = 1)"  I suppouse that it can be corrected by editing the string text to ==> Resource string (sevenspikes.themes.traction.common.itemboxcomparebutton) and the error will go away..... right?
please confirm
Thank you
Jose Plunkett
ehubcap


Hi Jose,

this has been already fixed. Please download the latest package of the theme and replace these files:

Themes/Traction/Views/Shared/_ProductBox.cshtml
Themes/Traction/Views/ReturnRequest/ReturnRequest.cshtml
Traction/Views/Customer/DownloadableProducts.cshtml
Themes/Traction/Views/Order/Details.cshtml

Plugins/SevenSpikes.Theme.Traction/Resources/Resources.en-us.xml

If you have done any modification to the files, you will need to merge them.

Hope this helps!

10 years ago

Lucrasoft wrote:
Is it possible to add functionality to search in product attribute combinations? Because we would like to search on the sku configured in the product attribute combinations.


Hi Lucrasoft,

Unfortunately this is not possible. The Instant search plugins uses SearchProducts method, which comes from NopCommerce and this method does not allow to search in product attribute combination.