Stack Exchange Network

Stack Exchange network consists of 174 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.

0
votes
0answers
12 views

Commerce 2 PayPal Express — “No value passed to payment” error

I've cobbled together a combined payment screen that has both PayPal Express and Stripe forms visible, one above the other. Stripe works fine but PayPal errors with 'ppxo_no_token_passed_to_payment'. ...
1
vote
0answers
32 views
+50

(How) can I fill a visitor's cart by using a link?

When using Commerce 2, is there a way to fill a client's cart with the contents of an (inactive) cart, by using a link? Use case: abandoned cart email.
0
votes
0answers
10 views

Sorting/Ordering states/counties in Commerce

Added a few new counties/states in Commerce, and I need them to output in alphabetical order in my checkout address dropdown. I'm not much of a Javascript guy, and can't for the life of me figure this ...
2
votes
0answers
31 views

Searching for Multiple Categories and Tags

I've been pulling my head for the past day on how to filter products with multiple categories. After a long search, I found and implemented on my project, Advanced Search with tags and categories It ...
0
votes
0answers
16 views

Error when creating product in Craft 3 module

The error I get is Call to a member function getProductTypes() on null in /vendor/craftcms/commerce/src/elements/Product.php:272 $productType = Plugin::getInstance()->getProductTypes()->...
1
vote
2answers
34 views

Frontend form to change Craft Commerce user's password?

I'm trying to modify Craft 3's example 'Change password' form to work with a logged in Commerce 2 user, and have copied that code to templates/setpassword.twig. Two problems... (1) The {{ code }} ...
1
vote
1answer
31 views

Get Commerce 2's Stripe subscription planData as object

How do I access a subscription plan's planData? Maybe as an object? I'm using Commerce 2 with the Stripe gateway. For example: {% set plans = craft.commerce.getPlans().getAllPlans() %} {% for plan ...
1
vote
1answer
33 views

Programmatically create a product using Craft Commerce 2?

The docs for v1 mention a method craft()->commerce_purchasables->saveElement(). This is omitted in the docs for v2. Does anyone know how I can create a product programmatically in PHP? $...
1
vote
1answer
41 views

Demo repo for an Adjuster module for Commerce 2?

Would it be possible for someone to create a demo of a barebones Adjuster module, similar to https://github.com/cliveportman/craftcommerce-adjuster but for Commerce 2? I'm trying to follow the docs ...
1
vote
1answer
19 views

Craft 3 Module Working but Throwing Errors in web.log

I'm seeing a lot of "Invalid argument" errors in the web.log for a "Multiple Option Variant" module I have running. It seems to be working just fine on the site, but curious as to what the issue might ...
1
vote
0answers
22 views

Product variant association

On my Products details page I have 2 selects. The 1st select list out the Primary variants. Based on the selected Primary variant the 2nd select is auto-completed in with Secondary variants that have ...
0
votes
1answer
18 views

“An error occurred while generating this PDF.” in Commerce 2

Like the title says, I cannot output order PDFs in Commerce 2 and not sure how to debug this. Anyone else encountered the same issue?
1
vote
1answer
26 views

Multiple cart fields/notes

First time using Commerce and made pretty good progress, but... I need to collect a few bits of information at the cart stage. The site is selling conference tickets, and I need to know: if the ...
1
vote
1answer
14 views

Update an order afterwards

Have to update an order afterwards cause the client can choose a retail partner. <form method="post" name="submitOrder" style="width: 100%" onkeypress="return event.keyCode != 13;"> <...
2
votes
0answers
20 views

Add custom column to the orders list page

Does anybody know if it is possible to add a column to the orders list page? I can choose the 'Foo' label, but when the page want to show the orders list I get the following error: "{"error":"An ...
2
votes
0answers
30 views

Commerce 2 Multi-site Support

I'm currently working on a multi-market Craft3 project with Commerce2. Each product can and will have a different fixed price on each page. Product A project.tld/de-de - € 120 project.tld/en-gb - £ ...
1
vote
2answers
54 views

Commerce 2 Subscription Prices

We've currently got Subscriptions setup on a site which works a charm, but my main issue is outputting the price of the subscription, after the user has subscribed. From the docs/templates I can even ...
1
vote
1answer
22 views

Get to get all users with active Commerce 2 subscription

How do I get all the users with an active subscription in Commerce 2? I want to be able to filter entries by subscribed users.
0
votes
0answers
29 views

Craft Commerce License / Commerce control panel inaccessible

I am fairly new to craft & commerce Using craft3 and Commerce2 I have been using a Pro Trial license and all was working fine, then I received these messages when I logged into the admin control ...
0
votes
0answers
19 views

Commerce: Is it possible to determine if a customer has used a discount?

The client would like to offer a single-use discount after the customer's first order is processed – that will be sent in an automated email when the order state changes. Is there a way to determine ...
1
vote
1answer
53 views

Using a custom Commerce 2 Adjuster in a Craft Plugin

I wrote a little commerce 2 price adjuster that works fine if i place it in /vendor/craftcms/commerce/src/adjusters/FriendsDiscountAdjuster.php and register it manually in /vendor/craftcms/commerce/...
1
vote
1answer
32 views

getTransactionByHash() must be of the type string, null given

I'm building my first Payment Gateway (offsite gateway) for Commerce 2. This one is for Moneris. I'm hitting an error when the page returns the response. Argument 1 passed to craft\commerce\...
2
votes
1answer
63 views

Is it possible to import orders into Craft Commerce?

We have to migrate a CSV dump from a Drupal commerce shop to Craft Commerce. It is important to import ‘Order Email’ / ‘Username’, ‘Order Date’, ‘Ordered Items’ (Name or ID), ‘Item Price’. Address ...
0
votes
0answers
13 views

Shipping Amount not added to cart.totalprice in Commerce 2

The shipping cost isn't added on to the cart total price after the shipping screen, is there something that I've missed out? Included the code snippet for the shipping screen as follows: <form ...
1
vote
1answer
32 views

Craft Commerce 2: PayPal Express not working - Correlation id: unknown

I try to get PayPal Express running but have quite some difficulties. I use the default templates for testing and can get through the whole checkout and payment process, but then PayPal closes and in ...
1
vote
0answers
16 views

Craft Commerce 2: Get products which are availableForPurchase

I try to get all the products of a certain category which have availableForPurchase set to true. {% set criteria = craft.products.type( 'weine' ).relatedTo( cat ).search( 'availableForPurchase:1' )....
1
vote
1answer
24 views

User-determined price for a product variant?

Is there a way in Craft Commerce 2 to have a user-input price as a product variant? In my case, I'm offering several pre-set amounts for a donation product (each is a variant), but I also want to ...
1
vote
1answer
30 views

Is there a way to localise error messages in Craft Commerce 2?

I'm using Craft Commerce v2 on a Craft 3 Pro website. The checkout process of the shop includes a number of forms such as the ones that visitor can use to add or edit shopping and billing addresses. ...
2
votes
1answer
52 views

Craft Commerce 2 - get order data for plugin

I want to write a plugin which writes all the order data into a CSV file. Unfortunately the documentation for Commerce 2 isn't quite complete yet so I have difficulties to find out how to do the ...
1
vote
1answer
42 views

Upgraded to Craft 3 and lost my Commerce Gateways

I upgraded to Craft 3 and I went to my payment gateways and I have the old ones in there with no details such as keys. And my only gateway options are Dummy and Manual. I know there were changes such ...
1
vote
0answers
19 views

Complex shipping logics

In Craft Commerce 2, we have two shipping categories: PostNL, which is one of the Dutch main shipping methods, which we use for packages that fit in the mailbox. For this category we use the weight ...
0
votes
0answers
38 views

Custom Commerce product type URL from custom field

I've run into a dead end when trying to create custom URL's for a product type in Commerce 2. I want to create the URL from a custom field -- a Commerce Product field to be exact. This product does ...
2
votes
1answer
40 views

How can I show a list of product options as checkboxes in the cart?

In my cart (Craft3/Commerce2), I need to show a line item's possible options from a checkbox field called "productOptions", and allow the user to select the desired options. Based on the Craft Docs, ...
1
vote
1answer
92 views

Craft Commerce 2 — Remove Line Item (and other actions)

Knowing that all other actions besides update-cart has been deprecated I'm curious what needs to be passed with the action to remove a line item from the cart using a button as opposed to check a ...
2
votes
1answer
45 views

Getting previous order history in a Commerce 2 adjuster

I am trying to write a Commerce 2 adjuster that will apply a discount on all items from a specific type if a customer bought a specific item with another product type in the last year as well as a ...
0
votes
0answers
16 views

Unable to apply Free (0 costs) shipping to the cart

If shipping doesn't cost anything (0) the cart doesn't get updated. The controller returns (test ajax) cart without shipping method being updated. If shipping method isn't free, the method ...
1
vote
1answer
70 views

302 redirect when updating the cart via Ajax using Craft Commerce 2

I'm working on a site that has recently migrated from Craft v2 with Commerce v1 to Craft v3 with Commerce v2. Using Commerce v1 I was able to update the cart via Ajax and get a data object with the ...
1
vote
1answer
152 views

Craft Commerce 2: Subscription Payment Gateway

I am working in Craft 3 with the Commerce 2 plugin. I am trying to create new subscription plan there. But I am not able to do so because I don't have any Payment Gateway Installed that supports ...
1
vote
1answer
25 views

Is there a way to retrieve discounts for a product in Craft Commerce v2?

I would like to retrieve all available discounts for an eshop using the Craft Commerce v2. In Craft Commerce v1, I could use the following: craft.commerce.discounts.all() However, I can't find an ...