How can I implement modifiable products (which are subscriptions) in Shopify? - shopify

I've implemented subscriptions through ReCharge where users can select products and these are saved as line item properties for that product. This was the only solution I could think of with my limited time using Shopify.
Per this question, it seems like line item properties are read-only after checkout. If this is truly the case, is there any solution that enables having modifiable subscriptions where users can re-select products for that subscription product that I can implement?
I'm using Shipstation for the shipping piece if this matters at all.

How can I implement modifiable products (which are subscriptions) in Shopify?
You can't. Well, technically you can but it is not easily done. Since you indicated that you're looking for official answers, I've contacted Shopify via email for you and I've been discussed this with Brad Leclerc, where he said:
That is indeed the case with line item properties being read-only after checkout, so it would need to be reconstructed for the new order. There's no super quick/easy to do that without some custom development to automate the process. If you end up wanting to do that, I'm sure a developer from http://experts.shopify.com could set something like that up.
You have two choices, either hire someone from experts.shopify.com to help or build your own marketing script from scratch.
Proof of email: http://i.imgur.com/OeM5gSm.png

I'd do this with meta fields on the customer.
meta fields can be used on the subscription product template to make it sensitive to the state of the customer's subscription (new or existing)
Use a order web hook to detect when a new subscription product has been purchased and then update the customer meta fields (e.g. subscription level and start and end dates).
use a periodic task in your supporting private app to:
prompt user before subscription becomes due to update their payment details or cancel the subscription
create and bill new orders for each subscription period

I am not familiar with Shopify, nor Revcharge, but according to the references, couldn't you simply customize the product page in shopify?
https://docs.shopify.com/manual/configuration/store-customization/page-specific/product-page/get-customization-information-for-products
According RevCharge, you should use a Shopify product template anyway..
http://recharge.helpscoutdocs.com/article/91-recharge-integration-guide

Related

Extend Spartacus NGRX Store with additional data

For our Spartacus project, we need to introduce additional Data properties in the checkout:
We have the case, that the user needs to select a delivery mode per product.
In an ideal world, upon selection, the selected delivery mode would be saved in the NGRX Store and also in the Backend to stay within the principle of the data binding defined here: https://sap.github.io/spartacus-docs/connecting-to-other-systems/#component-data-binding
Expected Data / User flow:
User goes to Checkout and to Delivery Mode Step
Custom OCC Call is made to load the supported delivery modes for each product (depends on product type and further customer specific logic)
The cart items are displayed, enhanced with a dropdown containing the available delivery modes
The user selects a delivery mode
The selected delivery mode is stored on the cart entry within the NGRX Store and saved in the backend
The new Cart totals is calculated based on the costs of the selected delivery mode
The new Cart totals is stored on the cart within the NGRX Store and saved in the backend
The user clicks on continue to get to the Review Order Step
The cart items are listed with the previously selected delivery mode
After some analysis of the existing code, we found a property deliveryMode on the orderEntry. This does not seem to be used anywhere in spartacus, but could be used to make Step 9 work by following this stackoverflow answer and this one.
Questions regarding this flow:
How can we extend the NGRX Store? We assume, it would be possible to just extend the facade (Active Cart Service), bypass the store and save the information in the backend (Described here) and afterwards refresh the store from the backend. Is that Assumption correct? If yes, that feels awkward though, as we need to reload the whole store just to contain the new property deliveryMode on the orderEntry
How can we hook into the price calculation of the cart totals to update the total based on the selected delivery mode? And again, how can we bring the new total sum into the store?
There seem to be several Answers within the Slack Channel without very few usable answers around extending the ngrx store, even though for us, it seems to be a quit normal task.. :-/
Any thoughts, inputs or support would be very appreciated. :-)
This seems like a difficult thing to accomplish seeing as delivery modes per product aren't supported as-is in spartacus. But some ideas:
You can extend core CartEntry classes (adapter, connecter, facade, etc.) to include the delivery mode for entries added to the cart. You will probably need to change all to include the delivery mode setting(s). All of these are exposed so you can modify them as needed including the store.
Utilizing multiple carts to have a product per cart and set delivery mode that way. But this would be cumbersome in my opinion.
As far as price calculation goes, I'm assuming OCC calls return total prices. Does the call for the cart entries include delivery mode costs per entry?
We have implemented the following work around and it works so far:
Enhance the Cart Model in the backend
Add new Endpoints to load the available delivery Modes per Product (by bypassing the NGRX Store)
Add new Endpoints to save the selected Delivery Mode (by bypassing the NGRX Store)
After Save Endpoint, a cart Reload is triggered, which loads the new cart totals having a custom property on the order entry (via type augmentation) into the store from the backend
It's already a lot of years past since Spartacus project started, but looks like it's still really raw projects. Spartacus is not ready to deal with real word customer's requirement and complexity of customize it quickly grow at real project(so you start to think do we really need it, as it's so unflexible at some dimentions). Some parts is really hard or not possible to customize, so you begin to search a workarounds(This question is one common case).
I think NGRX Store is one of the biggest pain in the ass to customize something at Spartacus. 2 years past and nothing changed by Spartacus team...

How to make some products available only for premium users

In my Sylius shop, I would like to make some products available only for my website premium users.
I managed to set up a promotion rule for premium users, according to the documentation : How to add a custom promotion rule?
My problem is that I can't figure out how to create a promotion action, making selected products available only to premium users. And these products need also to be seen by standard customers.
Is a promotion action a good way to achieve this purpose ?
I don't know if promotions are the best you can use in this feature. There is no discount/profit for the customer, it's just a limitation of product for specific customer group. I would solve this with two simple steps:
Add $premium flag on Product entity.
Implement a listener (or even better - a validator) that would check the currently logged in customer groups and if there is no premium, then break adding product to cart and display proper message.
Of course, you could create a promotion action that would remove products from cart that customer can't buy, but let's be honest, it'd be ridiculous ;)
Let me know if it's clear or you need any more help with that!

How do I access Shopify data without advanced account?

All I'm wanting to do is track sales of certain products from a certain date. My company is wanting to add a banner to track sales goals for raising money for charities. So basically, we'd tag a few products as being part of that goal, set a goal, and then need to update the goal progress by a certain amount every time a sale is made on one of those products. As far as I can tell, without access to Shopify's analytics API, this is not possible. How can I do this?
What you want to build is perfectly possible. However, you need to generate Private App Credentials, so you can use Shopify API. It doesn't matter if you have an account by yourself, someone else can follow these steps and send you the credentials your way.
If you don't actually need to modify anything through the API, you could have them set a webhook (Settings -> Notifications -> Webhook) on Order Creation (or similar) that posts to your server and you can check what product got sold and see if it has got the tag.
The "easy" way to do this is to create an app that receives order webhooks and can check on tagged products and keep a sum of target items sold.
Then the app should have use a script tag to insert a simple script with the current value into the web page at a configured place by css selector
OR the app could update one or more snippet files that you could include until the promo is done.
I'd tend to go with the script tag option since that's a bit more flexible and you should be able to change your theme when the promo is over to report results without having to touch the app again.

Big Commerce Integration for custom Email Invoice

I've looked into different ways to put or get order info from BC to different systems including the BC API, BC Webhooks, Zapier, and other systems like Shipworks.... in the end what I need to do is this:
We need orders placed on BigCommerce to send out a special invoice to the customer. The items that the customer purchased will have custom attributes, a "Tier" and a separate "Unit QTY" which is not the same as the item quantity.
We need to group the items by Tier, and show subtotals of the Unit Qty and Cost. Send this in an invoice as soon as the order is placed on the website.
We are already syncing to Quickbooks online, which does not have the functionality.
Looking for suggestions on different platforms/languages/email services like mailgun/and even shipping integration tools like shipworks, ordoro etc. that might have the ability to code a custom email template like this.
My customer is keeping bigcommerce, no option to switch this out.
I am mainly a Salesforce developer so my strong suit would be to sync the orders to SFDC and code in apex, send the invoice. But before investing in the time, wanted to see if I'm missing some quick potential solutions.
Anyone use Zapier Javascript/Python code platform?
Apologies if this is too open-ended. I feel that this could be a good reference for others in the community about options and best practices.
Hmm your question is pretty broad. Maybe a few links to API documentation could help?
Bigcommerce API - https://developer.bigcommerce.com/api
Ordoro API - https://www.ordoro.com/developer
Send this in an invoice as soon as the order is placed on the website.
I think what you need is a Bigcommerce webhook for store/order/created. See https://developer.bigcommerce.com/api/webhooks-getting-started.
Alternatively, you could set up a cron job that polls BigCommerce for new orders and then sends the email notification.

POST Order with values for configurable product fields?

I've successfully got 3rd party merchant orders posting new orders to my client's BigCommerce store programmatically. I've even got product options posting as part of the order (product->option set-> option relationships are a total cluster).
My client relies heavily on configurable fields. I'm able to pull the definitions of the configurable fields for each product, but can't find a way to POST or update the configurable field values through the API.
Is it possible to manipulate an order's configurable fields through the API?
Got a response from the support team # BigCommerce. Manipulating configurable fields via the API is not currently possible and not currently on the roadmap.
Original reply below:
Unfortunately that is a product limitation with the API, it will not tie to configurable fields on the product. The best you can do is attach that information through a generic text field like 'staff_notes'. Honestly I have not heard of any talk of adding a way to add products with configurable fields to orders via the API. I think this may be because anything that can be done with configurable fields can be done with options and options are what is being pushed for the future. I have noted this feedback down though and will pass it along to our Product Manager for the API. Best case scenario is that it may be seen in a future version of the API which is at least several months away.