Drupal Commerce: renew role / subscription - drupal

We are selling a product using Drupal Commerce that will renew yearly, but not automatically (expensive, users will likely use POs). Right now, after purchase, they will receive the appropriate role based on their purchase for 1 year.
If they pay before the end date, I would like them to get an additional, non-overlapping year.
I would like a solution that is independent of payment type because some things will be done manually.

I had implemented such a solution before. There was a subscription for a year,two years & three years. The problem was how to maintain the subscription limit & how to extend it.
The solution was creating a hidden field within for every user. When a user first buys a package for a year we programatically make a entry of the end timestamp in the end field. When he buys one more package the current timestamp value of the field is added by additional timestamp
timestamp = timestamp + 1years timestamp
or
timestamp = timestamp + 2years timestamp
Hope this helps you

Related

How to limit one order per day for each user in woocommerce

I need to limit users to purchase one order per day in woocommerce.
The woocommerce has limit order option.
when I set the limit option to 1, it works probably, but if user wants to edit order, he can not because when woocommerce starts edit an order, first create a new empty order in database, then after user ends the edition, woocommerce set last order as canceled and update new order.
As I set order limit to one, the empty order does not create, so the user cannot edit his order.
How can I force woocommerce to limit one order per day while users could edit that one order?

Why order is not working on /v2/shares endpoint

At hootsuite.com we are using v2/shares to create reports for multiple social profiles over large periods of time.
The documentation for that endpoint specifies here that: "Shares are ordered by creation time".
at the moment, when I go to https://api.linkedin.com/v2/shares?q=owners&owners=urn:li:organization:15100279&sharesPerOwner=500&start=290
I'll see "activity": "urn:li:activity:6537431951580684288" with createdTime 1558645236755 between two other shares that both have bigger createTime (1559217643294 and 1559131242301)
This means that the creation time is not the order.
If the order has been changed on lastModified time, please suggest a method to paginate through shares up to a last known share fetched 1 day ago, while guaranteeing no new shares were missed.

Conditional field value in Access 2007

I created a database to keep track of customer service related follow-ups in a call centre environment.
My table has, among the others, a Date created field, a Due date field and a Status field (Open, Due or Overdue).
I would like the value indicated in the Status field to update automatically as time elapses.
Can this be achieved and how?
This is absolutely possible. Why not? I would suggest you do the following:
(1) add another status to the status field called 'closed'
(2) determine from a logorithmic perspective what 'Due' means (e.g. if the current date falls within 5 days of your due date
(3) Write a query which updates your status either 'due' or 'overdue' depending on what the current date is
UPDATE tblDue SET tblDue.Status = "Due"
WHERE (((tblDue.DueDate)=Now()));
UPDATE tblDue SET tblDue.Status = "Overdue"
WHERE (((tblDue.DueDate)>Now()));

Amazon MWS API, listing seller's products that is updated after a specific date

I am trying to list the products of a seller (using marketplaceID) that is created or updated after a specific date.
I tried RequestReport with ReportType "_GET_MERCHANT_LISTINGS_DATA_" and setting StartDate to the target date but the data returned contains products that are created (or lastly updated) before that date.
https://developer.amazonservices.com/
The documentation is not very specific on what 'StartDate' actually does:
Start of a date range used for selecting the data to report.
Type: xs:datetime
Default: Now
If I recall correctly, this date does not relate to a products modification timestamps but to a products existance in the database. As an example, setting StartDate to yesterday should give you a list of products that were in the database within the last 24 hours. This includes products that were recently created and products that were created way before that but still exist.
I don't think it is possible to get a list of products that were modified within a timeframe (again, I'm writing this from my recollection on how this worked when I played with it)

Is Auto Reorder available in nopcommerce from customer front side?

We are customizing the nopCommerce for one of our client.
They need the functionality to auto reorder from customer front where customer select the cycle period and cycle times, they don't need Recurring product where admin set the cycle period and cycle times.
as of now, NopCommerce dont have such feature out of the box, so what you will have to do is create a plugin for it.
here is what you might look at.
1) create a table with customer id, product id, starting date, ending date, interval.
2) customer frontend view make design should support subscribing to a product, and post data to your plugin, and insert record in the new table for each product.
3) have a schedule task run daily against that table for orders that are due.

Resources