Shopify create order admin api not taking email all of a sudden - shopify

Admin API 2021-10 Orders endpoint is throwing the following error for already existing user
{\"customer\":[\"Email has already been taken\"]}
This problem was not there before. Does anyone know if something changed recently API-wise? no documentation regarding the update was found

Usually when creating orders, you would want to use a Customer ID for an order when creating it. So you check, via email, does this customer even exist? If it does, you just provide the ID. If you skip that step (remember, customers are a separate aspect of Shopify Orders), you may then run into this issue. Shopify is given an email, tries to create a customer, and the system says STOP RIGHT THERE, this customer already exists, and you never provided an ID.
Sounds weird, but maybe you never encountered this issue because you just never ran into repeat customers? As you know, most orders are one-time and not repeat at a lot of stores.
Not sure this explanation makes total sense, but anyway, the workaround I found was just to establish the customer BEFORE trying to create the order. Either you use an ID for an existing one, or, create a new one.

Related

Possible to assign order to account?

Is it possible to assign an order manually in the backend to a customer?
I couldn't find anything about it.
Unfortunately this is a regular task of our customer support.
You can create a new order manually in the administration.
You can't however retroactively change the customer of an order placed via the storefront, if that is what you meant. In theory you could do it programmatically by replacing customer specific associations of the order with new ones, based on another customer. It's still likely this would come with a few undesired side effects though.
I guess you mean: You want to create a order for a customer via the administration. For this, have a look into the docs:
https://docs.shopware.com/en/shopware-6-en/orders/create-order-in-admin

How do I create a custom payment module on Prestashop without a credit card?

This is the first time I've asked a question on here so I'm sure I'll be off on the question I'm trying to ask, but here's what I'm dealing with:
I'm using prestashop on my website that will only accept payment from people within our Bartering service group. So the only information needed for them to place an order is their contact information and their personal ID from the Bartering group so that we can accept the order and make sure they apply that. So I want to change the checkout to not actually charge anything, but rather send an email to the sales team and to the customer containing the product they ordered and their personal information. I've already done a couple of overrides with prestashop, but I haven't been able to find what all modules/classes need overridden for this particular issue.
Any advice even a basic list of what modules and classes to look at would be helpful. Thanks in advance.
Edit: Thanks for the advice folks. I think the module should be pretty straight forward. It does not have to charge any balance or anything, just send an email with the order details and customer info to both us and the customer.

VirtoCommerce - Creation of a new payment gateway

I have a big problem dealing with new payment gateway creation. I followed a tutorial but I think I did something wrong because it doesn't work well.
I would like to create a "devis" (sorry I don't know the word in english... It looks like that.
When the customer buys something, he could choose this kind of payment which does nothing but provide the "devis". It would be perfect if the status of the order could be "on hold" directly in order to unhold it when the "real payment" is done.
I hope you have understand what I try to do but if you have not be free to ask me questions.
Here is what I've done:
I created a new class in the VirtoCommerce.PaymentGateways namespace called DevisPaymentGateway which inherits from the PaymentGatewayBase class.
In this class there is just one method: ProcessPayment where I do:
payment.status = PaymentStatus.Completed.ToString();
in the SqlOrderDatabaseInitializer.cs
I created a private SetupDevisGateway method:
private void SetupPaypalGateway(List<PaymentGateway> gateways)
which is called in the CreatePaymentGateways method just after the paypal gateway.
I deployed the database thanks to your powershell script, the gateway
is created as expected.
I enabled the gateway payment via
VirtoCommerce Manager Then I bought something on the website and I
chose the new Payment which is available so it seems to work.
When I click on proceed to checkout I have a new order line which is created
with the "Pending" status so it's perfect...
When I bought something with paypal for example, there was the same reaction BUUUT when the new order line was created there was the onBeforeUpdate method which detected that new line and some work was done asynchronously. With the new gateway it seems that the onBeforeUpdate method doesn't work anymore...
I think that I've forgot something which is done with Paypal and not with my gateway but what and where?
I already know that it's not a good idea to write something in the SqlOrderDatabaseInitializer.cs but I don't think that it's the problem... Does anybody have a solution?
Thanks
Edit: Explanation on what I try to achieve:
Products which are sold are in fact a couple: "images treatments" + "images"
Each customer can manage album and put photos into it, and when he clicks on a product (which is a treatment) he can choose an album.
So it's why I need this event, when the payment is done and the status change from pending to in progress, I send relevant information (about the treatment, the album...) to a queue and I have worker roles (one for each treatment) which read these messages and do some work.
I hope you understand the idea but if you don't, do not hesitate to ask me questions
can you explain why do you need that event? What will you do when that event is raised?
Some explanation below on how status is changed for the order below:
The order status is actually changed by the job "ProcessOrderStatusWork class" that simply runs in the background and changes the status order status from "Pending" to "InProgress" after order has been in pending state for a certain period of time. I would suggesting for you to create a copy of "ProcessOrderStatusWork" class and create a new job (name it MyProcessOrderStatusWork class), that in addition to changing status also adds custom work for your payment. You can then register that Job and disable the one included with VC, so it is not duplicated (by adding it in the database,similar to how you did payment gateway).
It might work for PayPal, because it uses slightly different logic, as order created on call back from PayPal, thus executing in the same web process and event is raised.

EE2 - bypass a login with a unique URL?

I have a weird problem - I'm working on a portfolio site built in Expression Engine that has a number of clients who all obviously need to log in to access their portfolio.
I've been asked to see if there's a way that a user could login once, and then somehow, from then on, be able to bypass the login screen when they return to the site - the main client is keen on a unique URL, and I can't see how this would be done. I'm a bit of a novice with Expression Engine, so if anyone has any tips I'd love to hear them!
Cheers in advance.
You would need to build an add-on with a module and extension to do this. Many steps involved, but doable.
create a new table to hold some sort of unique ID, a member_id, and probably an expiry date
insert a new action when your module is installed, and have a corresponding method which will handle logins in your module
use the member_member_login_start extension hook to insert a new row into this table, and then to generate an email which is sent to the member's email address which contains an action URL built using the unique value you just inserted (e.g., http:/mysite.com/?ACT=XX&unique_id=XXXXXX)
Something like that.

Web store: will customers come back to re-place orders?

Recently a bug in our web store caused the prices to be doubled at checkout. This lead to a drop in orders from about 25 to 2 over a period of 19 hours. We have lost quite some money over this. What I wonder is: is there any way to measure how many of those "dropped" customers will come back and re-place their orders?
If they logged in, their user details. If not, compare IP addresses from your server log, IPs which left without buying during the price doubling, to IPs in the next week, to get a rough idea.
I would say if your product is good your customers will come back. I would say now is a good time to start collecting some analytics on your site. You won't have much to compare to but it would be a place to start. To tell if your customers are coming back you could compare the purchase data from before the issue to after. I would think you'd have some type of userid they would have to either log in with or enter when purchasing. Our sites all require a username to login, we also offer a guest checkout which is just an email address but we could comparisons if we needed to.
A non-programming solution is to offer customers who had the problem some kind of discount or additional product if they finalise their order. This doesn't help you find out how many come back because you are changing the rules, but it will help you lose some of the lost money.
If you have a mailing list, mail out the special offer, else put it up on your website somewhere.
Ask them to fill in the details of the order again, if it matches a previous order in that time period offer them the special deal.