Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [plugin-craftcommerce2]

The tag has no usage guidance.

1
vote
1answer
6 views

How to display Craft Commerce subscription description from a linked entry

I must be missing something obvious here but I don't see any reference to this in the docs. Under Commerce Settings > Subscription plans > You can link a related entry to the Description but it is ...
0
votes
0answers
8 views

Filter and sort commerce products based on matrix blocks

We have a website that uses Craft CMS v3.1.28 and Commerce v2.1.6.1. The below logic is implemented within a plugin and we're prepared to do custom implementations aka. prepared to go deep! This ...
1
vote
1answer
44 views

Is there any plugin for Blog in Craft 3?

I want to create a Blog website in craft cms. I would like to know, is there any plugin for Blog which we can use in Craft similar kind of WordPress?
0
votes
0answers
18 views

Merge trashed element with existing one

Is there any way to merge trashed elements with an existing element? I'm creating a custom restore action so you can merge a trashed (commerce) Product with an existing one. The mergeElementsByIds ...
1
vote
1answer
15 views

Craft Commerce Order Notifications from customer email and name

Quite a specific question from a client on another e-commerce system who would maybe like to move to Craft Commerce. I have used Craft for a few client sites now but not Commerce as of yet. Basically,...
0
votes
0answers
18 views

How do I call complete a purchase

I am trying to implement a 3D secure payment gateway and I am having a trouble completing the purchase. I am debugging it but the CompletePurchaseRequest is never called. Here is my PurchaseRequest ...
0
votes
0answers
15 views

How to set action url and inputs for redirect template

How do I set the actionUrl and inputs variables values in the redirect template for payment ? of the gatewayPostRedirectTemplate config.
2
votes
2answers
42 views

Getting started with Craft Commerce 2 subscriptions using Stripe

I’m new to Craft Commerce and am really having trouble getting started with subscriptions. I used the example from the docs and nothing happened. When reloading the cp though, it kept telling me "...
1
vote
1answer
14 views

Cart - only one item at a time

In my cart on Commerce, I only get to have one item at a time. If I try to add another item, it replaces the item that was already in the cart. I have used {% set cart = craft.commerce.getCart() %} ...
0
votes
0answers
14 views

Print to Console Inside Event

I created a CUSTOM PLUGIN and I have the following code: Event::on(FOO::class, FOO::EVENT_NAMED_BAR, function(Event $e) { $message = "Hello world"; // craft::error( $message ); // ...
1
vote
0answers
34 views

Is it possible to change the group that a user belongs in the front-end?

A little background: The website runs on Craft v.3 Pro and Commerce v.2 Pro The user can register as a member from the front-end. They will be able to select only one of 3 different groups to ...
1
vote
1answer
21 views

Importing Commerce Variants from google sheet

How I should set up google sheet data to import Commerce Variants from it? It is necessary that the Variants are imported in the same way as this example. Thanks.
3
votes
2answers
54 views

Commerce 2: View all orders of a specific product?

I'm looking to generate a sales report for a specific product It should not be linked to a user's orders but just a general list of sales for that product and its variants Is this possible? Thanks
1
vote
1answer
28 views

Commerce 2 — Guest checkout error: no customer email address exists on this cart

I'm having a problem with checking out as a Guest. Below is the design so you can see what I'm talking about... Although I'm entering an email address in the Guest Checkout email field — when I get ...
1
vote
1answer
24 views

How to use Saved Card in Craft Commerce

I was able to save cards by using savePaymentSource parameter in my payment form submitting at commerce/payments/pay. But how do I use these saved cards for making payments? I am using Stripe payment ...
1
vote
1answer
30 views

Custom Plugin for ZenDesk Tickets [closed]

I need all of the custom fields on an order submitted to ZenDesk to create a new ticket once the order is completed. Once a ticket is created in ZenDesk, we will need the ticket number saved on a new ...
2
votes
1answer
26 views

Setting Quantity Field on Subscriptions

How can I pass in a quantity value while creating a subscription? Plugin (version): Craft CMS (3.1.21) Craft Commerce (2.1.2) Stripe for Craft Commerce (1.2.0) Problem: My website allows users to ...
1
vote
1answer
19 views

How to display the featured image on a Commerce product:

How do I display the featured image on a Commerce product: <figure> <a href="{{ entry.url }}"> <img src="{{ entry.featuredImage[0].getUrl('medium') }}" alt=""> <...
1
vote
1answer
96 views

Dynamically update line item in Commerce 2

I'm currently trying to adjust the line items in a particular cart/order after an event is triggered. I've got: use craft\commerce\Plugin as CommercePlugin; $this->requirePostRequest(); $request ...
1
vote
1answer
43 views

Donation Status Commerce 2

Currently trying to use the new Donations feature of Commerce 2 - https://docs.craftcms.com/commerce/v2/donations.html The order goes through fine and I can see the donation purchasable in the order. ...
1
vote
0answers
32 views

Create Manual Order for another customer

Is there any way for an admin to use the Manual gateway and create an order for another customer in the system? Or is the only option for the admin to Log In as User feature and go through the ...
1
vote
1answer
34 views

Craft Commerce 2 - extend Order details page

Let's say we're on the order details page with the 3 tabs - Order Details, Transactions, Status History How do I add an extra tab with content? Craft V3 / Commerce V2 Thanks
1
vote
1answer
8 views

Shipping for other category than what's set as default is not applied to total

Somehow, shipping rates are not applied to the total when checking out and paying. It does show when selecting the shipping method, but not on the final order review and is not submitted as part of ...
1
vote
1answer
15 views

Cart completed at gateway redirect issue

Recently I've found that when a customer goes to checkout and hits the craft\commerce\controllers actionPay() using a custom gateway that it's automatically marking the cart as complete. This never ...
0
votes
0answers
25 views

Looping over categories, product variants, and subsequently applying adjuster(s)?

Using the Craft 3 and Commerce 2 APIs, how would one go about looping through products in the cart to apply adjusters, looking at the following example; A category, "Product Packs" is set up where ...
0
votes
1answer
45 views

Create different types of Donation purchasable? (for Gift Aid etc)

The new donations purchasable looks super handy for charity websites, thank you for this :) In the UK we have a thing called Gift Aid that allows charities to claim an extra 25% on donations/...
1
vote
1answer
43 views

Order Adjusters in Commerce 2

In Craft Commerce 1, there is documentation on how to re-order adjustments that do similar things. https://docs.craftcms.com/commerce/v1/adjusters.html#ordering-adjustments But I don't see any ...
1
vote
1answer
28 views

Mark a cart as complete from a plugin

How do I mark a cart as complete from a plugin? I tried setting isComplete = 1, it gets moved to orders but it is still a cart.
1
vote
1answer
27 views

How to display payment gateway error message only

I am trying to display the error message coming from the payment gateway ONLY. I know I can use {% set message = craft.app.session.getFlash('error') %} {{ message|length ? message }} but commerce ...
1
vote
1answer
40 views

Product Combination Discount in Commerce 2?

Is there a way to set a discount in Commerce 2 that applies when, for example, three various products are in the cart? Use case; Say you have a blue shirt, a black pant and a red cardigan, in the ...
2
votes
0answers
36 views

Unable to register adjuster in module

Following https://docs.craftcms.com/commerce/v2/adjusters.html I am unable to register an adjuster in my module. in my Module.php file I have placed the following inside init() alongside other stuff ...
1
vote
0answers
44 views

XMLHttpRequest Craft Commerce Cart Update Issues

When using XMLHttpRequest to update cart like the following, I get a 500 error for 'lineItems': {[lineitem]: {'qty': value}} (and also {[lineitem]: {'remove': true}}, any other submission works); var ...
1
vote
1answer
23 views

How to access a digital products information on the products page in Craft Commerce?

I have created a digital product type and a digital product but strangely on the digital products template I can't access any information regarding the product like for example, entry.title. I'm ...
1
vote
1answer
24 views

How to set Commerce 2 confirmation email in .env file?

We're just in the process of upgrading from Craft 2 with Commerce 1 to Craft 3 and Commerce 2. One of the issues we had before was that the client was getting confirmation emails for test orders. Is ...
3
votes
1answer
104 views

Selling tickets to repeating events with Commerce (and Solspace Calendar?)

We need to build a ticketing system for venue tours, that happen every week within certain date ranges, and with an option to exclude specific dates from the availability list. Looking at Solspace ...
1
vote
0answers
24 views

How to keep a users cart active after logout - Craft Commerce 2

How do I set the cart to save / stay active in a users account. When I add some products to my cart (when logged in) and logout or close my browser the next time I come back my cart is empty. I'd like ...
1
vote
0answers
19 views

How to modifyPaymentRequest() in Commerce 2?

Looks that I really used every functionality in my plugin that changed or has been removed in Commerce 2. :( I need to modify paypal transactionId and description what i did as follows in Commerce 1: ...
0
votes
0answers
9 views

No EVENT_DEFAULT_ORDER_STATUS in craft\commerce\services\LineItems?

The Commerce 2 docs shows LineItems::EVENT_DEFAULT_ORDER_STATUS as a parameter for the event beforeSaveLineItem and afterSaveLineItem, but craft\commerce\services\LineItems did not have a constant ...
1
vote
0answers
15 views

What are the replacements for the order events onBeforeAddToCart and onBeforeGatewayRequestSend in Commerce 2

I'm looking for replacements for the events onBeforeAddToCart and onBeforeGatewayRequestSend. I used onBeforeAddToCart to prevent the user from adding an article from different article groups to the ...
1
vote
1answer
110 views

Product Filtering with Tags

I've built a product filtering system using tags and currently have 2 available tag groups under different fields. Size and Type Currently if I select 1 tag from both size and type, it shows all ...
1
vote
2answers
28 views

TwigExtension added to Craft don’t work in emails

I added tomodomo/twig-pluralize-extension to my project composer, loaded with a custom module like that : if (Craft::$app->request->getIsSiteRequest()) { // Add in our Twig extension $...
1
vote
2answers
29 views

Skipping the shipping part for custom virtual product

We've a WIP that need virtual products. Not the official plugin, but a custom product type that don’t required any shipping. I was wondering if anyone ever try to do so, and how. I was thinking about ...
1
vote
1answer
60 views

Upgrading Commerce 1 to Commerce 2

Folks: I've got an e-commerce site that I'm upgrading. I've upgraded to Craft 3 and can reach the CP and the home page. This site is tightly integrated with Commerce 1. When I visit the plug-in page,...
2
votes
0answers
40 views

Commerce 2 Subscriptions (Using Stripe API)

I'm currently trying to implement and understand how Subscriptions work on Commerce 2. I'm using Stripe API and have created the subscriptions on their CP. I've listed them on my shop page and added ...
2
votes
2answers
96 views

Craft Commerce 2.0.2 Shipping Rule Names & Descriptions—How?

I just noticed I had to update some templates after updating to the latest Commerce version (2.0.2). How does one go about getting the method's rule description? I currently have it set up to apply ...
1
vote
1answer
18 views

Getting orders by property in Commerce 2 from Plugin

In Commerce 1 i can select orders by a specific property as follows: $criteria = craft()->elements->getCriteria('Commerce_Order'); $criteria['orderStatusId'] = 1; return craft()->elements-&...
1
vote
2answers
69 views

DB Queries in Craft Commerce 2 with large data

Currently working on an e-commerce site, which currently has over 4000 products with a mass of variants (averaging 3 variants per product) - and hit a few hurdles on the way... At present, craft....
1
vote
1answer
48 views

How to get core shipping methods in Commerce 2? How to save an order?

Is there an equivalent function to commerce_shippingMethods->getAllCoreShippingMethods() in Commerce 2? I can only find Commerce::getInstance()->getShippingMethods()->getAllShippingMethods();...
1
vote
1answer
79 views

Get all variants from multiple products

I need to get a list of variants from multiple products, but in a way that allows us to show the results in Craft's handy {% paginate %} tags. So far we have this less-than-appealing markup: {% set ...
0
votes
1answer
88 views

ERR_EMPTY_RESPONSE when accessing order data (MAMP)

I've got a local installation of Craft 3.0.37 and Craft Commerce 2.0.0-beta.15 running on MAMP. When completing an order, an empty response is given by the browser. The same thing happens when trying ...